Closed luelista closed 5 years ago
Linking #4875; PR #4884 fixed this bug last month; please try the latest pre-release build & confirm. Thanks!
Confirmed successful parse with 2.4.1.4647; closing as fixed. Thanks for the report! We will be releasing 2.4.2 soon, just a few more wrinkles need ironing. :smiley:
Ah thanks, I should've searched the closed issues as well...
Rubberduck version information The info below can be copy-paste-completed from the first lines of Rubberduck's log or the About box:
Description The following syntax causes a parse error from rubberduck, but is valid VB6 (optional Color is left off, but "B" option is given).
The MSDN spec of the Line Method is like this:
The grammar of the lineSpecialForm seems to be slightly off.
https://github.com/rubberduck-vba/Rubberduck/blob/master/Rubberduck.Parsing/Grammar/VBAParser.g4#L574
lineSpecialForm : expression whiteSpace ((STEP whiteSpace?)? tuple)? MINUS (STEP whiteSpace?)? tuple whiteSpace? (COMMA whiteSpace? expression)? whiteSpace? (COMMA whiteSpace? lineSpecialFormOption)?;
I think the correct grammer would be:
lineSpecialForm : expression whiteSpace ((STEP whiteSpace?)? tuple)? MINUS (STEP whiteSpace?)? tuple whiteSpace? (COMMA whiteSpace? expression? whiteSpace? (COMMA whiteSpace? lineSpecialFormOption)?)?;
Logfile
Excerpt from the log file when trying to parse above code:
2019-05-03 22:27:25.6284;WARN-2.4.1.4627;Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase;SLL mode failed while parsing the CodePaneCode version of module Form1 at symbol , at L134C45. Retrying using LL.; 2019-05-03 22:27:26.0391;ERROR-2.4.1.4627;Rubberduck.Parsing.VBA.Parsing.ModuleParser;Syntax error; offending token ';' at line 146, column 29 in the CodePaneCode version of module app_printer.; 2019-05-03 22:27:26.0391;INFO-2.4.1.4627;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState (20) is invoking StateChanged (Error); 2019-05-03 22:27:26.3050;ERROR-2.4.1.4627;Rubberduck.Parsing.VBA.Parsing.ModuleParser;Syntax error; offending token ',' at line 134, column 45 in the CodePaneCode version of module Form1.;