diff options
author | hjk <hjk121@nokiamail.com> | 2013-10-05 20:49:54 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-10-07 21:06:18 +0200 |
commit | 0db55795920682f1d59e461c91f2b886799063f5 (patch) | |
tree | 28fab9ee32fc0dd19b1b9b0cf73286b9d7d7f2a6 /src/libs/3rdparty/cplusplus/Lexer.cpp | |
parent | 2187195995b9e0192f79b6f3705704d70b430645 (diff) |
CPlusPlus: Fix parsing of <: :> <% %> %: digraphs
See 2.5/2.12. Most useful feature ever.
Change-Id: I3f92256733e15078df56205dba9746ffff8ed145
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Lexer.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Lexer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp index 1c56558773..66baa54e65 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.cpp +++ b/src/libs/3rdparty/cplusplus/Lexer.cpp @@ -269,6 +269,9 @@ void Lexer::scan_helper(Token *tok) if (_yychar == ':') { yyinp(); tok->f.kind = T_COLON_COLON; + } else if (_yychar == '>') { + yyinp(); + tok->f.kind = T_RBRACKET; } else { tok->f.kind = T_COLON; } @@ -428,6 +431,12 @@ void Lexer::scan_helper(Token *tok) if (_yychar == '=') { yyinp(); tok->f.kind = T_PERCENT_EQUAL; + } else if (_yychar == '>') { + yyinp(); + tok->f.kind = T_RBRACE; + } else if (_yychar == ':') { + yyinp(); + tok->f.kind = T_POUND; } else { tok->f.kind = T_PERCENT; } @@ -515,6 +524,12 @@ void Lexer::scan_helper(Token *tok) } else if (_yychar == '=') { yyinp(); tok->f.kind = T_LESS_EQUAL; + } else if (_yychar == ':') { + yyinp(); + tok->f.kind = T_LBRACKET; + } else if (_yychar == '%') { + yyinp(); + tok->f.kind = T_LBRACE; } else { tok->f.kind = T_LESS; } |