From 0db55795920682f1d59e461c91f2b886799063f5 Mon Sep 17 00:00:00 2001 From: hjk Date: Sat, 5 Oct 2013 20:49:54 +0200 Subject: CPlusPlus: Fix parsing of <: :> <% %> %: digraphs See 2.5/2.12. Most useful feature ever. Change-Id: I3f92256733e15078df56205dba9746ffff8ed145 Reviewed-by: Erik Verbruggen Reviewed-by: Nikolai Kosjar --- src/libs/3rdparty/cplusplus/Lexer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/libs/3rdparty') 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; } -- cgit v1.2.1