mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-31 04:03:27 +02:00
This commit is contained in:
parent
1549ba8899
commit
87821eb4fc
2 changed files with 16 additions and 9 deletions
|
@ -1473,15 +1473,6 @@ public class ScannerTestCase extends BaseScannerTest
|
||||||
assertEquals( callback.problems.size(), 1 );
|
assertEquals( callback.problems.size(), 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// public void testGerman() throws ScannerException
|
|
||||||
// {
|
|
||||||
// initializeScanner("\"Lißä\" 'ß' /* Lißä */ Lißä ");
|
|
||||||
// validateString("Lißä");
|
|
||||||
// validateChar( 'ß' );
|
|
||||||
// validateIdentifier( "Lißä");
|
|
||||||
// validateEOF();
|
|
||||||
// }
|
|
||||||
|
|
||||||
public void test54778() throws ScannerException
|
public void test54778() throws ScannerException
|
||||||
{
|
{
|
||||||
|
@ -1563,4 +1554,12 @@ public class ScannerTestCase extends BaseScannerTest
|
||||||
validateString( "ab"); //$NON-NLS-1$
|
validateString( "ab"); //$NON-NLS-1$
|
||||||
validateEOF();
|
validateEOF();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug62042() throws Exception
|
||||||
|
{
|
||||||
|
Callback callback = new Callback(ParserMode.QUICK_PARSE);
|
||||||
|
initializeScanner( "0x", ParserMode.QUICK_PARSE, callback ); //$NON-NLS-1$
|
||||||
|
validateEOF();
|
||||||
|
assertFalse( callback.problems.isEmpty() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ import org.eclipse.cdt.internal.core.parser.util.TraceUtil;
|
||||||
|
|
||||||
public class Scanner implements IScanner {
|
public class Scanner implements IScanner {
|
||||||
|
|
||||||
|
protected static final String HEX_PREFIX = "0x"; //$NON-NLS-1$
|
||||||
private static final ObjectMacroDescriptor CPLUSPLUS_MACRO = new ObjectMacroDescriptor( __CPLUSPLUS, "199711L"); //$NON-NLS-1$
|
private static final ObjectMacroDescriptor CPLUSPLUS_MACRO = new ObjectMacroDescriptor( __CPLUSPLUS, "199711L"); //$NON-NLS-1$
|
||||||
private static final ObjectMacroDescriptor STDC_VERSION_MACRO = new ObjectMacroDescriptor( __STDC_VERSION__, "199001L"); //$NON-NLS-1$
|
private static final ObjectMacroDescriptor STDC_VERSION_MACRO = new ObjectMacroDescriptor( __STDC_VERSION__, "199001L"); //$NON-NLS-1$
|
||||||
protected static final ObjectMacroDescriptor STDC_HOSTED_MACRO = new ObjectMacroDescriptor( __STDC_HOSTED__, "0"); //$NON-NLS-1$
|
protected static final ObjectMacroDescriptor STDC_HOSTED_MACRO = new ObjectMacroDescriptor( __STDC_HOSTED__, "0"); //$NON-NLS-1$
|
||||||
|
@ -1131,7 +1132,14 @@ public class Scanner implements IScanner {
|
||||||
|
|
||||||
int tokenType = floatingPoint ? IToken.tFLOATINGPT : IToken.tINTEGER;
|
int tokenType = floatingPoint ? IToken.tFLOATINGPT : IToken.tINTEGER;
|
||||||
if( tokenType == IToken.tINTEGER && hex )
|
if( tokenType == IToken.tINTEGER && hex )
|
||||||
|
{
|
||||||
|
if( result.equals( HEX_PREFIX) )
|
||||||
|
{
|
||||||
|
handleProblem( IProblem.SCANNER_BAD_HEX_FORMAT, HEX_PREFIX, beginOffset, false, true );
|
||||||
|
return null;
|
||||||
|
}
|
||||||
tokenType = IToken.tHEXINT;
|
tokenType = IToken.tHEXINT;
|
||||||
|
}
|
||||||
|
|
||||||
return newToken(
|
return newToken(
|
||||||
tokenType,
|
tokenType,
|
||||||
|
|
Loading…
Add table
Reference in a new issue