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
|
lexerBlock
|
||||||
: LPAREN lexerAltList RPAREN
|
@after {
|
||||||
-> ^(BLOCK<BlockAST>[$LPAREN,"BLOCK"] lexerAltList )
|
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
|
// channel=HIDDEN, skip, more, mode(INSIDE), push(INSIDE), pop
|
||||||
|
|
|
@ -381,7 +381,7 @@ labeledLexerElement
|
||||||
;
|
;
|
||||||
|
|
||||||
lexerBlock
|
lexerBlock
|
||||||
: ^(BLOCK lexerAlternative+)
|
: ^(BLOCK optionsSpec? lexerAlternative+)
|
||||||
;
|
;
|
||||||
|
|
||||||
lexerAtom
|
lexerAtom
|
||||||
|
|
Loading…
Reference in New Issue