#236 LXR::Lang::Pascal is broken

v1.2
closed-fixed
None
5
2013-05-26
2013-05-25
No

Trying LXR with android source, and it exits with this error:

*** android-4.1.2_r2 /external/antlr/antlr-3.4/runtime/Delphi/Sources/Antlr3.Runtime.Tests/
Scalar found where operator expected at lib/LXR/Lang/Pascal.pm line 128, near ") # Erase keyword
$dirname"
(Missing operator before $dirname?)
Unable to load LXR::Lang::Pascal Lang class, syntax error at lib/LXR/Lang/Pascal.pm line 128, near "s/^([\w]+)//) # Erase keyword
"
Compilation failed in require at (eval 27552) line 2.

reverting Pascal.pm to LXR v1.1 solved the issue.

Discussion

  • Andre-Littoz

    Andre-Littoz - 2013-05-26

    Double (or n x) shame on me!
    I had no handy Pascal code available and I did not test thoroughly this parser.

    A parenthesis ) has been typed at end of line 127 instead of a semicolon ;. Replace:

    $source =~ s/^([\w]+)//)    # Erase keyword
            # Faulty ------^
    

    with:

    $source =~ s/^([\w]+)//;    # Erase keyword
            # Correct -----^
    

    Note that Pascal parsing is embryonic because there are many dialects. I haven't practised it for many years; consequently I'm interesting in your experience. Send me feedback for parsing improvement. For instance, rereading the LXR definition of Pascal, I notice I left a C++ comment description in it (the // -> end-of-line variant).

    Also, most probably, ctags, which is responsible for feeding the dictionary with entities, does not track variables.

    Thanks for reporting this bug.
    ajl

     
    Last edit: Andre-Littoz 2013-05-26
  • Andre-Littoz

    Andre-Littoz - 2013-05-26
    • assigned_to: Andre-Littoz
     
  • Andre-Littoz

    Andre-Littoz - 2013-05-26

    Fixed in CVS

     
  • Andre-Littoz

    Andre-Littoz - 2013-05-26
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks