From 7bd0bc7534d8068894ea6d8bb1522b595b3fe3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 17 May 2017 22:50:54 +0200 Subject: [PATCH] Tokenizer: Simplify '->' to '.' --- lib/tokenize.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ad138f714..001c727dc 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1803,9 +1803,7 @@ void Tokenizer::combineOperators() const bool cpp = isCPP(); // Combine tokens.. - for (Token *tok = list.front(); - tok && tok->next(); - tok = tok->next()) { + for (Token *tok = list.front(); tok && tok->next(); tok = tok->next()) { const char c1 = tok->str()[0]; if (tok->str().length() == 1 && tok->next()->str().length() == 1) { @@ -1870,6 +1868,9 @@ void Tokenizer::combineOperators() tok->str(tok->str() + ":"); tok->deleteNext(); } + } else if (tok->str() == "->") { + tok->str("."); + tok->originalName("->"); } } }