forked from jasder/antlr
Allow optionsSpec at the beginning of a lexer block
This commit is contained in:
parent
c68c058280
commit
b3b1a3750d
|
@ -595,8 +595,17 @@ labeledLexerElement
|
|||
;
|
||||
|
||||
lexerBlock
|
||||
: LPAREN lexerAltList RPAREN
|
||||
-> ^(BLOCK<BlockAST>[$LPAREN,"BLOCK"] lexerAltList )
|
||||
@after {
|
||||
GrammarAST options = (GrammarAST)$tree.getFirstChildWithType(ANTLRParser.OPTIONS);
|
||||
if ( options!=null ) {
|
||||
Grammar.setNodeOptions($tree, options);
|
||||
}
|
||||
}
|
||||
: LPAREN
|
||||
( optionsSpec COLON )?
|
||||
lexerAltList
|
||||
RPAREN
|
||||
-> ^(BLOCK<BlockAST>[$LPAREN,"BLOCK"] optionsSpec? lexerAltList )
|
||||
;
|
||||
|
||||
// channel=HIDDEN, skip, more, mode(INSIDE), push(INSIDE), pop
|
||||
|
|
|
@ -381,7 +381,7 @@ labeledLexerElement
|
|||
;
|
||||
|
||||
lexerBlock
|
||||
: ^(BLOCK lexerAlternative+)
|
||||
: ^(BLOCK optionsSpec? lexerAlternative+)
|
||||
;
|
||||
|
||||
lexerAtom
|
||||
|
|
Loading…
Reference in New Issue