mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
Changed infinite-loop checking to use hashcodes rather than offsets, as offsets are not unique when we expand macros. <sigh>
This commit is contained in:
parent
7bac8a490b
commit
058f823d2e
1 changed files with 13 additions and 13 deletions
|
@ -147,9 +147,9 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int checkOffset = LA(1).getOffset();
|
int checkOffset = LA(1).hashCode();
|
||||||
declaration(compilationUnit, null, null);
|
declaration(compilationUnit, null, null);
|
||||||
if (LA(1).getOffset() == checkOffset)
|
if (LA(1).hashCode() == checkOffset)
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
catch (EndOfFileException e)
|
catch (EndOfFileException e)
|
||||||
|
@ -355,7 +355,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
linkage.enterScope( requestor );
|
linkage.enterScope( requestor );
|
||||||
linkageDeclarationLoop : while (LT(1) != IToken.tRBRACE)
|
linkageDeclarationLoop : while (LT(1) != IToken.tRBRACE)
|
||||||
{
|
{
|
||||||
int checkToken = LA(1).getOffset();
|
int checkToken = LA(1).hashCode();
|
||||||
switch (LT(1))
|
switch (LT(1))
|
||||||
{
|
{
|
||||||
case IToken.tRBRACE :
|
case IToken.tRBRACE :
|
||||||
|
@ -369,11 +369,11 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
catch (BacktrackException bt)
|
catch (BacktrackException bt)
|
||||||
{
|
{
|
||||||
failParse();
|
failParse();
|
||||||
if (checkToken == LA(1).getOffset())
|
if (checkToken == LA(1).hashCode())
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (checkToken == LA(1).getOffset())
|
if (checkToken == LA(1).hashCode())
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
// consume the }
|
// consume the }
|
||||||
|
@ -891,7 +891,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
setCompletionValues(scope,CompletionKind.VARIABLE_TYPE, Key.DECLARATION );
|
setCompletionValues(scope,CompletionKind.VARIABLE_TYPE, Key.DECLARATION );
|
||||||
namespaceDeclarationLoop : while (LT(1) != IToken.tRBRACE)
|
namespaceDeclarationLoop : while (LT(1) != IToken.tRBRACE)
|
||||||
{
|
{
|
||||||
int checkToken = LA(1).getOffset();
|
int checkToken = LA(1).hashCode();
|
||||||
switch (LT(1))
|
switch (LT(1))
|
||||||
{
|
{
|
||||||
case IToken.tRBRACE :
|
case IToken.tRBRACE :
|
||||||
|
@ -905,11 +905,11 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
catch (BacktrackException bt)
|
catch (BacktrackException bt)
|
||||||
{
|
{
|
||||||
failParse();
|
failParse();
|
||||||
if (checkToken == LA(1).getOffset())
|
if (checkToken == LA(1).hashCode())
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (checkToken == LA(1).getOffset())
|
if (checkToken == LA(1).hashCode())
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
setCompletionValues(scope, CompletionKind.NO_SUCH_KIND,Key.EMPTY );
|
setCompletionValues(scope, CompletionKind.NO_SUCH_KIND,Key.EMPTY );
|
||||||
|
@ -2649,7 +2649,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
handleClassSpecifier( astClassSpecifier );
|
handleClassSpecifier( astClassSpecifier );
|
||||||
memberDeclarationLoop : while (LT(1) != IToken.tRBRACE)
|
memberDeclarationLoop : while (LT(1) != IToken.tRBRACE)
|
||||||
{
|
{
|
||||||
int checkToken = LA(1).getOffset();
|
int checkToken = LA(1).hashCode();
|
||||||
switch (LT(1))
|
switch (LT(1))
|
||||||
{
|
{
|
||||||
case IToken.t_public :
|
case IToken.t_public :
|
||||||
|
@ -2679,11 +2679,11 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
catch (BacktrackException bt)
|
catch (BacktrackException bt)
|
||||||
{
|
{
|
||||||
failParse();
|
failParse();
|
||||||
if (checkToken == LA(1).getOffset())
|
if (checkToken == LA(1).hashCode())
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (checkToken == LA(1).getOffset())
|
if (checkToken == LA(1).hashCode())
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
// consume the }
|
// consume the }
|
||||||
|
@ -3092,7 +3092,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
|
|
||||||
while (LT(1) != IToken.tRBRACE)
|
while (LT(1) != IToken.tRBRACE)
|
||||||
{
|
{
|
||||||
int checkToken = LA(1).getOffset();
|
int checkToken = LA(1).hashCode();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
statement((IASTCodeScope) (createNewScope ? newScope : scope) );
|
statement((IASTCodeScope) (createNewScope ? newScope : scope) );
|
||||||
|
@ -3100,7 +3100,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
catch( BacktrackException b )
|
catch( BacktrackException b )
|
||||||
{
|
{
|
||||||
failParse();
|
failParse();
|
||||||
if( LA(1).getOffset() == checkToken )
|
if( LA(1).hashCode() == checkToken )
|
||||||
errorHandling();
|
errorHandling();
|
||||||
}
|
}
|
||||||
setCompletionValues(((createNewScope ? newScope : scope )), CompletionKind.SINGLE_NAME_REFERENCE,
|
setCompletionValues(((createNewScope ? newScope : scope )), CompletionKind.SINGLE_NAME_REFERENCE,
|
||||||
|
|
Loading…
Add table
Reference in a new issue