C++: Lex correctly a u8"literal"

Previously it was considering invalid things `such as U8"literal".

Change-Id: Icf4d051a26617ac2c6cb35d5a98f8af0ed801556
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Leandro Melo
2012-08-16 09:33:45 +02:00
parent df0d3c28ac
commit a590087749

View File

@@ -579,8 +579,7 @@ void Lexer::scan_helper(Token *tok)
} else if (_yychar == '\'') { } else if (_yychar == '\'') {
yyinp(); yyinp();
scanCharLiteral(tok, ch); scanCharLiteral(tok, ch);
} else { } else if (ch == 'u' && _yychar == '8') {
if (_yychar == '8') {
unsigned char la = 0; unsigned char la = 0;
if (_currentChar + 1 != _lastChar) if (_currentChar + 1 != _lastChar)
la = *(_currentChar + 1); la = *(_currentChar + 1);
@@ -598,7 +597,6 @@ void Lexer::scan_helper(Token *tok)
} else { } else {
scanIdentifier(tok); scanIdentifier(tok);
} }
}
} else if (std::isalpha(ch) || ch == '_' || ch == '$') { } else if (std::isalpha(ch) || ch == '_' || ch == '$') {
scanIdentifier(tok); scanIdentifier(tok);
} else if (std::isdigit(ch)) { } else if (std::isdigit(ch)) {