forked from jasder/antlr
V3 semantic predicate gate (=>) can only appear after a predicate {...}?, not an action {...}
This commit is contained in:
parent
3e91065824
commit
aace1ce399
|
@ -298,15 +298,16 @@ ARG_ACTION
|
||||||
//
|
//
|
||||||
ACTION
|
ACTION
|
||||||
: NESTED_ACTION
|
: NESTED_ACTION
|
||||||
('?' {$type = SEMPRED;} )?
|
( '?' {$type = SEMPRED;}
|
||||||
( '=>' // v3 gated sempred
|
( '=>' // v3 gated sempred
|
||||||
{
|
{
|
||||||
Token t = new CommonToken(input, state.type, state.channel, state.tokenStartCharIndex, getCharIndex()-1);
|
Token t = new CommonToken(input, state.type, state.channel, state.tokenStartCharIndex, getCharIndex()-1);
|
||||||
t.setLine(state.tokenStartLine);
|
t.setLine(state.tokenStartLine);
|
||||||
t.setText(state.text);
|
t.setText(state.text);
|
||||||
t.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
t.setCharPositionInLine(state.tokenStartCharPositionInLine);
|
||||||
grammarError(ErrorType.V3_GATED_SEMPRED, t);
|
grammarError(ErrorType.V3_GATED_SEMPRED, t);
|
||||||
}
|
}
|
||||||
|
)?
|
||||||
)?
|
)?
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue