mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cleaned up translationUnit() backtracking.
This commit is contained in:
parent
9eda3a1323
commit
7b873687b6
1 changed files with 3 additions and 3 deletions
|
@ -141,7 +141,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
return;
|
||||
}
|
||||
|
||||
IToken lastBacktrack = null;
|
||||
int lastBacktrack = -1;
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
{
|
||||
// Mark as failure and try to reach a recovery point
|
||||
failParse();
|
||||
if (lastBacktrack != null && lastBacktrack == LA(1))
|
||||
if (lastBacktrack != -1 && lastBacktrack == LA(1).hashCode())
|
||||
{
|
||||
// we haven't progressed from the last backtrack
|
||||
// try and find tne next definition
|
||||
|
@ -172,7 +172,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
else
|
||||
{
|
||||
// start again from here
|
||||
lastBacktrack = LA(1);
|
||||
lastBacktrack = LA(1).hashCode();
|
||||
}
|
||||
}
|
||||
catch (EndOfFileException e)
|
||||
|
|
Loading…
Add table
Reference in a new issue