interface.ccl parser reports error for extra spaces after in function alias block

Create issue
Issue #748 closed
Jian Tao created an issue

E.g., if there are extra spaces after "LANGUAGE C" in the function alias block, the parser will report an missing "Language specification" error instead of discarding the extra spaces.

PROVIDES FUNCTION MoLRegisterConstrainedGroup WITH \ MoL_RegisterConstrainedGroup \ LANGUAGE C

`

Keyword: CST
Keyword: parser

Comments (8)

  1. Erik Schnetter
    • changed status to open
    • removed comment

    Please test this patch:

    Index: interface_parser.pl

    --- interface_parser.pl (revision 4788) +++ interface_parser.pl (working copy) @@ -746,7 +746,7 @@ $funcname = $1; $provided_by = $2;

    - if($provided_by =~ m/(.*)\s*LANGUAGE\s*(.+)/i) + if($provided_by =~ m/(.*)\s*LANGUAGE\s*(.+)\s*/i) { $provided_by = $1; $provided_by_language = "\U$2";

  2. Erik Schnetter
    • removed comment

    Right. The pattern should end in

    LANGUAGE\s+(.*\S)\s*/i

    (which is still not quite right, because no space in front of LANGUAGE is required).

  3. Erik Schnetter
    • changed status to open
    • removed comment

    This is the patch I am suggesting:

    Index: interface_parser.pl

    --- interface_parser.pl (revision 4788) +++ interface_parser.pl (working copy) @@ -746,7 +746,7 @@ $funcname = $1; $provided_by = $2;

    - if($provided_by =~ m/(.*)\s*LANGUAGE\s*(.+)/i) + if($provided_by =~ m/(.*)\s* LANGUAGE\s+(.*\S)\s*/i) { $provided_by = $1; $provided_by_language = "\U$2";

  4. Erik Schnetter
    • changed status to resolved
    • removed comment

    Corrected and applied. The regexp is now

    if($provided_by =~ m/^(.*)\s+LANGUAGE\s+(.*\S)\s*$/i)

  5. Log in to comment