Skip to content

Commit

Permalink
Fix missing 'fragment' attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Goff committed Jun 26, 2015
1 parent f1fde33 commit 0381a18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion corpus/VisualBasic6.g4
Expand Up @@ -910,4 +910,4 @@ fragment V:('v'|'V');
fragment W:('w'|'W');
fragment X:('x'|'X');
fragment Y:('y'|'Y');
fragment Z:('z'|'Z');
fragment Z:('z'|'Z');
2 changes: 1 addition & 1 deletion lib/ANTLR4/Actions/AST.pm
Expand Up @@ -436,7 +436,7 @@ method lexerRuleSpec($/)
[
$/<lexerAltList>>>.ast
],
attribute => [ ],
attribute => $/<FRAGMENT> ?? [ ~$/<FRAGMENT> ] !! [ ],
action => Nil,
returns => Nil,
throws => [ ],
Expand Down
6 changes: 5 additions & 1 deletion lib/ANTLR4/Grammar.pm
Expand Up @@ -337,9 +337,13 @@ rule parserAlt
<parserElement> <COMMENTS>? ['#' <label=ID> <COMMENTS>?]?
}

token FRAGMENT
{
'fragment'
}
rule lexerRuleSpec
{
<COMMENTS>? 'fragment'?
<COMMENTS>? <FRAGMENT>?
<COMMENTS>? <name=ID>
<COMMENTS>? ':'
<COMMENTS>? <lexerAltList>
Expand Down

0 comments on commit 0381a18

Please sign in to comment.