mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
Bug 429361 - 'u8' token after #ifdef
Change-Id: Idc780473ca6356397f6466adff7ad0ee92a23fd0 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/23087 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
83d0b2be3e
commit
b930b2d66a
2 changed files with 23 additions and 7 deletions
|
@ -10572,4 +10572,13 @@ public class AST2CPPTests extends AST2TestBase {
|
||||||
public void testParenthesizedReferenceArgument_424898() throws Exception {
|
public void testParenthesizedReferenceArgument_424898() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// typedef unsigned char u8;
|
||||||
|
//
|
||||||
|
// #ifndef X
|
||||||
|
// u8 var;
|
||||||
|
// #endif
|
||||||
|
public void testU8TokenAfterIfdef_429361() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,10 +90,17 @@ final public class Lexer implements ITokenSequence {
|
||||||
private Token fLastToken;
|
private Token fLastToken;
|
||||||
|
|
||||||
// For the few cases where we have to lookahead more than one character
|
// For the few cases where we have to lookahead more than one character
|
||||||
|
private int fMarkPhase3Offset;
|
||||||
|
private int fMarkPhase3EndOffset;
|
||||||
|
private int fMarkPhase3PrefetchedChar;
|
||||||
|
|
||||||
|
// To store the entire state. Note that we don't reuse the variables
|
||||||
|
// used for saving the phase3 because calls to markPhase3() and
|
||||||
|
// restorePhase3() can occur in between calls to saveState() and
|
||||||
|
// restoreState().
|
||||||
private int fMarkOffset;
|
private int fMarkOffset;
|
||||||
private int fMarkEndOffset;
|
private int fMarkEndOffset;
|
||||||
private int fMarkPrefetchedChar;
|
private int fMarkPrefetchedChar;
|
||||||
// To store the entire state.
|
|
||||||
private boolean fMarkInsideIncludeDirective;
|
private boolean fMarkInsideIncludeDirective;
|
||||||
private Token fMarkToken;
|
private Token fMarkToken;
|
||||||
private Token fMarkLastToken;
|
private Token fMarkLastToken;
|
||||||
|
@ -1006,18 +1013,18 @@ final public class Lexer implements ITokenSequence {
|
||||||
* with a long prefix.
|
* with a long prefix.
|
||||||
*/
|
*/
|
||||||
private void markPhase3() {
|
private void markPhase3() {
|
||||||
fMarkOffset= fOffset;
|
fMarkPhase3Offset= fOffset;
|
||||||
fMarkEndOffset= fEndOffset;
|
fMarkPhase3EndOffset= fEndOffset;
|
||||||
fMarkPrefetchedChar= fCharPhase3;
|
fMarkPhase3PrefetchedChar= fCharPhase3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restores a previously saved state of phase3.
|
* Restores a previously saved state of phase3.
|
||||||
*/
|
*/
|
||||||
private void restorePhase3() {
|
private void restorePhase3() {
|
||||||
fOffset= fMarkOffset;
|
fOffset= fMarkPhase3Offset;
|
||||||
fEndOffset= fMarkEndOffset;
|
fEndOffset= fMarkPhase3EndOffset;
|
||||||
fCharPhase3= fMarkPrefetchedChar;
|
fCharPhase3= fMarkPhase3PrefetchedChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue