Delete remaining commented out syncs.

These sync calls are truly redundant - when we are in a simple
alternative block, we can recover sufficiently with `recoverInline`, and
so the syncs do not add anything.
This commit is contained in:
Michael Peyton Jones 2015-09-07 11:56:14 +01:00
parent 940cbcf19f
commit 797cf08111
3 changed files with 29 additions and 3 deletions

View File

@ -11,6 +11,7 @@ TestTemplates ::= [
"LL2": [],
"LL3": [],
"LLStar": [],
"SingleTokenDeletionBeforeAlt": [],
"SingleTokenDeletionBeforePredict": [],
"SingleTokenDeletionBeforeLoop": [],
"MultiTokenDeletionBeforeLoop": [],

View File

@ -0,0 +1,28 @@
TestType() ::= "Parser"
Options ::= [
"Debug": false
]
Grammar ::= [
"T": {<grammar("T")>}
]
Input() ::= "ac"
Rule() ::= "a"
Output() ::= <<
>>
Errors() ::= <<
line 1:0 extraneous input 'a' expecting {'b', 'c'}
>>
grammar(grammarName) ::= <<
grammar <grammarName>;
a : ('b' | 'c')
;
q : 'a'
;
>>

View File

@ -469,7 +469,6 @@ CodeBlockForAlt(currentAltCodeBlock, locals, preamble, ops) ::= <<
LL1AltBlock(choice, preamble, alts, error) ::= <<
setState(<choice.stateNumber>);
<!_errHandler.sync(this);!>
<if(choice.label)><labelref(choice.label)> = _input.LT(1);<endif>
<preamble; separator="\n">
switch (_input.LA(1)) {
@ -483,7 +482,6 @@ default:
LL1OptionalBlock(choice, alts, error) ::= <<
setState(<choice.stateNumber>);
<!_errHandler.sync(this);!>
switch (_input.LA(1)) {
<choice.altLook,alts:{look,alt| <cases(ttypes=look)>
<alt>
@ -495,7 +493,6 @@ default:
LL1OptionalBlockSingleAlt(choice, expr, alts, preamble, error, followExpr) ::= <<
setState(<choice.stateNumber>);
<!_errHandler.sync(this);!>
<preamble; separator="\n">
if (<expr>) {
<alts; separator="\n">