File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Rubberduck.Parsing/Grammar Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -301,9 +301,14 @@ UNDERSCORE : '_';
301
301
WS : [ \t];
302
302
GUIDLITERAL : ' {' [0-9A-F ]+ ' -' [0-9A-F ]+ ' -' [0-9A-F ]+ ' -' [0-9A-F ]+ ' -' [0-9A-F ]+ ' }' ;
303
303
IDENTIFIER : ~[[\](){} \r\n\t.,' "|!@#$%^&*\- +:=; 0-9-/\\ -] ~[[\] (){}\r\n\t .,' " |!@#$%^&*\- +:=; -]*;
304
- LINE_CONTINUATION : [ \t ]+ UNDERSCORE [ \t ]* '\r '? '\n ';
304
+ LINE_CONTINUATION : [ \t ]+ UNDERSCORE [ \t ]* '\r '? '\n ' WS_NOT_FOLLOWED_BY_LINE_CONTINUATION* ;
305
305
// The following rule is needed in order to capture hex literals without format prefixes which start with a digit. Needed for VBForm resources.
306
- BARE_HEX_LITERAL : [0-9] [0-9a-fA-F]*;
306
+ BARE_HEX_LITERAL : [0-9] [0-9a-fA-F]*;
307
+ fragment WS_NOT_FOLLOWED_BY_LINE_CONTINUATION : [ \t ] {(char)_input.La(1) != '_'
308
+ || ((char)_input.La(2) != '\r '
309
+ && (char)_input.La(2) != '\n '
310
+ && (char)_input.La(2) != '\t '
311
+ && (char)_input.La(2) != ' ')}?;
307
312
fragment LETTER : [a-zA-Z_äöüÄÖÜ];
308
313
fragment DIGIT : [0-9];
309
314
fragment LETTERORDIGIT : [a-zA-Z0-9_äöüÄÖÜ];
Original file line number Diff line number Diff line change @@ -601,7 +601,7 @@ complexType :
601
601
fieldLength : MULT whiteSpace? (numberLiteral | identifierValue);
602
602
603
603
// Statement labels can only appear at the start of a line.
604
- statementLabelDefinition : {_input.La(-1 ) == NEWLINE} ? (combinedLabels | identifierStatementLabel | standaloneLineNumberLabel);
604
+ statementLabelDefinition : {_input.La(-1 ) == NEWLINE || _input.La(- 1 ) == LINE_CONTINUATION } ? (combinedLabels | identifierStatementLabel | standaloneLineNumberLabel);
605
605
identifierStatementLabel : legalLabelIdentifier whiteSpace? COLON ;
606
606
standaloneLineNumberLabel :
607
607
lineNumberLabel whiteSpace? COLON
You can’t perform that action at this time.
0 commit comments