1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
John Camelon 2004-06-06 05:07:12 +00:00
parent a549ff4f27
commit da96e2c080
3 changed files with 28 additions and 2 deletions

View file

@ -1919,4 +1919,17 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
{
parse( "class Sample;\nstruct Sample { /* ... */ };" ); //$NON-NLS-1$
}
public void testBug64268() throws Exception
{
Writer writer = new StringWriter();
writer.write("#define BODY \\\n"); //$NON-NLS-1$
writer.write("for (;;) { \\\n"); //$NON-NLS-1$
writer.write("/* this multi-line comment messes \\\n"); //$NON-NLS-1$
writer.write("up the parser. */ }\n"); //$NON-NLS-1$
writer.write(" void abc() {\n"); //$NON-NLS-1$
writer.write("BODY\n"); //$NON-NLS-1$
writer.write("}\n"); //$NON-NLS-1$
parse( writer.toString() );
}
}

View file

@ -1631,4 +1631,18 @@ public class ScannerTestCase extends BaseScannerTest
validateToken( IToken.tSEMI );
validateEOF();
}
public void testBug64268() throws Exception
{
Writer writer = new StringWriter();
writer.write("#define BODY \\\n"); //$NON-NLS-1$
writer.write(" { \\\n"); //$NON-NLS-1$
writer.write(" /* this multi-line comment messes \\\n"); //$NON-NLS-1$
writer.write(" up the parser. */ }\n"); //$NON-NLS-1$
writer.write("BODY "); //$NON-NLS-1$
initializeScanner( writer.toString() );
validateToken( IToken.tLBRACE);
validateToken( IToken.tRBRACE);
validateEOF();
}
}

View file

@ -471,8 +471,7 @@ public final class Scanner implements IScanner, IScannerData {
break;
} else if (next == '*') {
// multiline comment
if (skipOverMultilineComment())
break;
skipOverMultilineComment();
c = getChar( true );
continue;
} else {