C++: Fix support for incremental input with \n

Also fix false positive line continuation on blank line

e.g.
"foo \

bar"

Change-Id: Ic6d345a4b578c955411d119b8438c8dc5065c072
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Orgad Shaneh
2014-01-23 22:16:43 +02:00
committed by Orgad Shaneh
parent fd31b4716c
commit e600424648
6 changed files with 76 additions and 31 deletions

View File

@@ -99,6 +99,11 @@ private:
unsigned _scanAngleStringLiteralTokens: 1;
};
struct State {
unsigned char _tokenKind : 7;
unsigned char _newlineExpected : 1;
};
TranslationUnit *_translationUnit;
Control *_control;
const char *_firstChar;
@@ -106,7 +111,10 @@ private:
const char *_lastChar;
const char *_tokenStart;
unsigned char _yychar;
int _state;
union {
unsigned char _state;
State s;
};
union {
unsigned _flags;
Flags f;