mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
This commit is contained in:
parent
a549ff4f27
commit
da96e2c080
3 changed files with 28 additions and 2 deletions
|
@ -1919,4 +1919,17 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
|
||||||
{
|
{
|
||||||
parse( "class Sample;\nstruct Sample { /* ... */ };" ); //$NON-NLS-1$
|
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() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1631,4 +1631,18 @@ public class ScannerTestCase extends BaseScannerTest
|
||||||
validateToken( IToken.tSEMI );
|
validateToken( IToken.tSEMI );
|
||||||
validateEOF();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -471,8 +471,7 @@ public final class Scanner implements IScanner, IScannerData {
|
||||||
break;
|
break;
|
||||||
} else if (next == '*') {
|
} else if (next == '*') {
|
||||||
// multiline comment
|
// multiline comment
|
||||||
if (skipOverMultilineComment())
|
skipOverMultilineComment();
|
||||||
break;
|
|
||||||
c = getChar( true );
|
c = getChar( true );
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue