1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Fixed Bug 56517 - Preprocessor skipping doesn't ignore the contents of string literals.

This commit is contained in:
John Camelon 2004-03-29 20:56:02 +00:00
parent d6b510d200
commit 13b3c99749
4 changed files with 25 additions and 4 deletions

View file

@ -1,3 +1,6 @@
2004-03-29 John Camelon
Added ScannerTestCase::testBug56517().
2004-03-28 John Camelon
Removed ScannerTestCase::testGerman() until we can figure out how to make it portable.

View file

@ -1579,4 +1579,21 @@ public class ScannerTestCase extends BaseScannerTest
validateEOF();
}
public void testBug56517() throws Exception
{
Writer writer = new StringWriter();
writer.write( "#if 0 \n");
writer.write( "char * x = \"#boo\";\n" );
writer.write( "#endif\n");
initializeScanner( writer.toString() );
validateEOF();
// validateToken( IToken.t_char);
// validateToken( IToken.tSTAR);
// validateIdentifier( "x");
// validateToken( IToken.tASSIGN );
// validateString( "#boo");
// validateToken(IToken.tSEMI);
// validateEOF();
}
}

View file

@ -1,3 +1,6 @@
2004-03-29 John Camelon
Fixed Bug 56517 - Preprocessor skipping doesn't ignore the contents of string literals.
2004-03-28 John Camelon
Remove warnings.

View file

@ -1215,9 +1215,8 @@ public class Scanner implements IScanner {
scannerExtension.handlePreprocessorDirective( token, getRestOfPreprocessorLine() );
else
{
StringBuffer buffer = new StringBuffer( "#"); //$NON-NLS-1$
buffer.append( token );
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true );
if( passOnToClient )
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, token, beginningOffset, false, true );
}
return null;
}
@ -1510,7 +1509,6 @@ public class Scanner implements IScanner {
while (c != NOCHAR) {
if ( ! passOnToClient ) {
while (c != NOCHAR && c != '#' )
{
c = getChar();