mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Brutally painful Parser2 fixes.
This commit is contained in:
parent
edd4a3ebf0
commit
894e597b9e
1 changed files with 28 additions and 10 deletions
|
@ -865,7 +865,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
declSpecifier = declSpecifierSeq(false, true);
|
declSpecifier = declSpecifierSeq(false, false);
|
||||||
declarator = declarator( SimpleDeclarationStrategy.TRY_CONSTRUCTOR );
|
declarator = declarator( SimpleDeclarationStrategy.TRY_CONSTRUCTOR );
|
||||||
}
|
}
|
||||||
catch( BacktrackException bt )
|
catch( BacktrackException bt )
|
||||||
|
@ -989,9 +989,16 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
backtrackMarker = mark();
|
backtrackMarker = mark();
|
||||||
newPlacementExpressions = expression();
|
newPlacementExpressions = expression();
|
||||||
consume(IToken.tRPAREN);
|
consume(IToken.tRPAREN);
|
||||||
|
if( LT(1) == IToken.tLBRACKET )
|
||||||
|
{
|
||||||
|
backup( backtrackMarker );
|
||||||
if (templateIdScopes.size() > 0) {
|
if (templateIdScopes.size() > 0) {
|
||||||
templateIdScopes.pop();
|
templateIdScopes.pop();
|
||||||
} //pop 1st Parent
|
} //pop 1st Parent
|
||||||
|
placementParseFailure = true;
|
||||||
|
throwBacktrack( backtrackMarker.getOffset(), backtrackMarker.getEndOffset(), backtrackMarker.getLineNumber(), backtrackMarker.getFilename() );
|
||||||
|
}
|
||||||
|
else
|
||||||
placementParseFailure = false;
|
placementParseFailure = false;
|
||||||
if (LT(1) == IToken.tLPAREN) {
|
if (LT(1) == IToken.tLPAREN) {
|
||||||
beforeSecondParen = mark();
|
beforeSecondParen = mark();
|
||||||
|
@ -3237,7 +3244,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
List arrayMods = Collections.EMPTY_LIST;
|
List arrayMods = Collections.EMPTY_LIST;
|
||||||
List exceptionSpecIds = Collections.EMPTY_LIST;
|
List exceptionSpecIds = Collections.EMPTY_LIST;
|
||||||
boolean encounteredVarArgs = false;
|
boolean encounteredVarArgs = false;
|
||||||
boolean tryEncountered = true;
|
boolean tryEncountered = false;
|
||||||
IASTExpression bitField = null;
|
IASTExpression bitField = null;
|
||||||
boolean isFunction = false;
|
boolean isFunction = false;
|
||||||
boolean isPureVirtual = false, isConst = false, isVolatile = false;
|
boolean isPureVirtual = false, isConst = false, isVolatile = false;
|
||||||
|
@ -3247,15 +3254,26 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
consumePointerOperators(pointerOps);
|
consumePointerOperators(pointerOps);
|
||||||
|
|
||||||
if (LT(1) == IToken.tLPAREN) {
|
if (LT(1) == IToken.tLPAREN) {
|
||||||
|
IToken mark = mark();
|
||||||
|
try
|
||||||
|
{
|
||||||
consume();
|
consume();
|
||||||
innerDecl = declarator(strategy);
|
innerDecl = declarator(strategy);
|
||||||
consume(IToken.tRPAREN);
|
consume(IToken.tRPAREN);
|
||||||
|
}
|
||||||
|
catch( BacktrackException bte )
|
||||||
|
{
|
||||||
|
backup( mark );
|
||||||
|
}
|
||||||
declaratorName = createName();
|
declaratorName = createName();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
declaratorName = createName( consumeTemplatedOperatorName() );
|
ITokenDuple d = consumeTemplatedOperatorName();
|
||||||
|
declaratorName = createName( d );
|
||||||
|
if( d.isConversion() )
|
||||||
|
isFunction = true;
|
||||||
}
|
}
|
||||||
catch( BacktrackException bt )
|
catch( BacktrackException bt )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue