1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Fixed Bug 37019  - RTS: Parser fails on variable defn using constructor 
	Fixed Bug 36767  - STL Testing: Parser is confused and goes into template function body 

TESTS
	Moved testBug37019() from DOMFailedTests to DOMTests.
This commit is contained in:
John Camelon 2003-04-28 20:00:35 +00:00
parent 85cb30cd54
commit 0ab192cb95
5 changed files with 30 additions and 22 deletions

View file

@ -1,3 +1,7 @@
2003-04-28 John Camelon
Fixed Bug 37019 - RTS: Parser fails on variable defn using constructor
Fixed Bug 36767 - STL Testing: Parser is confused and goes into template function body
2003-04-28 John Camelon 2003-04-28 John Camelon
Partial fix for Bug37002 - Order of Offsetables is wrong Partial fix for Bug37002 - Order of Offsetables is wrong

View file

@ -107,7 +107,7 @@ c, quick);
checkToken = LA(1); checkToken = LA(1);
declaration( translationUnit ); declaration( translationUnit );
if( LA(1) == checkToken ) if( LA(1) == checkToken )
consumeToNextSemicolon(); errorHandling();
} catch (EndOfFile e) { } catch (EndOfFile e) {
// Good // Good
break; break;
@ -119,7 +119,7 @@ c, quick);
if (lastBacktrack != null && lastBacktrack == LA(1)) { if (lastBacktrack != null && lastBacktrack == LA(1)) {
// we haven't progressed from the last backtrack // we haven't progressed from the last backtrack
// try and find tne next definition // try and find tne next definition
consumeToNextSemicolon(); errorHandling();
} else { } else {
// start again from here // start again from here
lastBacktrack = LA(1); lastBacktrack = LA(1);
@ -136,12 +136,12 @@ c, quick);
try{ callback.translationUnitEnd(translationUnit);} catch( Exception e ) {} try{ callback.translationUnitEnd(translationUnit);} catch( Exception e ) {}
} }
protected void consumeToNextSemicolon() throws Backtrack { protected void errorHandling() throws Backtrack {
failParse(); failParse();
consume(); consume();
// TODO - we should really check for matching braces too // TODO - we should really check for matching braces too
int depth = 0; int depth = 0;
while (LT(1) != Token.tSEMI || depth != 0 ) { while ( ! ( (LT(1) == Token.tSEMI && depth == 0 ) || ( LT(1) == Token.tRBRACE && depth == 1 ) ) ){
switch( LT(1)) switch( LT(1))
{ {
case Token.tLBRACE: case Token.tLBRACE:
@ -154,8 +154,8 @@ c, quick);
consume(); consume();
} }
// eat the SEMI as well // eat the SEMI/RBRACE as well
consume(Token.tSEMI); consume();
} }
/** /**
@ -279,11 +279,11 @@ c, quick);
{ {
failParse(); failParse();
if( checkToken == LA(1)) if( checkToken == LA(1))
consumeToNextSemicolon(); errorHandling();
} }
} }
if (checkToken == LA(1)) if (checkToken == LA(1))
consumeToNextSemicolon(); errorHandling();
} }
// consume the } // consume the }
consume(); consume();
@ -548,11 +548,11 @@ c, quick);
{ {
failParse(); failParse();
if (checkToken == LA(1)) if (checkToken == LA(1))
consumeToNextSemicolon(); errorHandling();
} }
} }
if (checkToken == LA(1)) if (checkToken == LA(1))
consumeToNextSemicolon(); errorHandling();
} }
// consume the } // consume the }
@ -1184,7 +1184,7 @@ c, quick);
try try
{ {
try{ expression = callback.expressionBegin( declarator ); } catch( Exception e ) {} try{ expression = callback.expressionBegin( declarator ); } catch( Exception e ) {}
constantExpression( expression ); expression( expression );
try{ callback.expressionEnd( expression ); } catch( Exception e ) {} try{ callback.expressionEnd( expression ); } catch( Exception e ) {}
} }
catch( Backtrack b ) catch( Backtrack b )
@ -1429,7 +1429,7 @@ c, quick);
break; break;
default: default:
System.out.println( "Unexpected Token =" + LA(1).getImage() ); System.out.println( "Unexpected Token =" + LA(1).getImage() );
consumeToNextSemicolon(); errorHandling();
continue; continue;
} }
} }
@ -1685,11 +1685,11 @@ c, quick);
{ {
failParse(); failParse();
if (checkToken == LA(1)) if (checkToken == LA(1))
consumeToNextSemicolon(); errorHandling();
} }
} }
if (checkToken == LA(1)) if (checkToken == LA(1))
consumeToNextSemicolon(); errorHandling();
} }
// consume the } // consume the }
try{ callback.classSpecifierEnd(classSpec, consume( Token.tRBRACE )); } catch( Exception e ) {} try{ callback.classSpecifierEnd(classSpec, consume( Token.tRBRACE )); } catch( Exception e ) {}

View file

@ -1,3 +1,6 @@
2003-04-28 John Camelon
Moved testBug36730() & testBug37019() from DOMFailedTests to DOMTests.
2003-04-28 Andrew Niefer 2003-04-28 Andrew Niefer
Added DOMFailedTest::testBug37019 Added DOMFailedTest::testBug37019
Added DOMFailedTest::testBug36932 Added DOMFailedTest::testBug36932

View file

@ -21,15 +21,12 @@ public class DOMFailedTest extends BaseDOMTest {
super(name); super(name);
} }
public void testBug36730(){
failTest("FUNCTION_MACRO( 1, a );\n int i;");
}
public void testBug37019(){
failTest("static const A a( 1, 0 );");
}
public void testBug36932() { public void testBug36932() {
failTest("A::A( ) : var( new char [ (unsigned)bufSize ] ) {}"); failTest("A::A( ) : var( new char [ (unsigned)bufSize ] ) {}");
} }
public void testBug36730()throws Exception {
failTest("FUNCTION_MACRO( 1, a )\n int i;");
}
} }

View file

@ -1779,5 +1779,9 @@ public class DOMTests extends BaseDOMTest {
assertFalse( i.hasNext() ); assertFalse( i.hasNext() );
} }
public void testBug37019() throws Exception {
parse("static const A a( 1, 0 );");
}
} }