From f1aa9eb48f12cb770721614f28e4403aa7215ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 15 Sep 2022 19:57:17 +0200 Subject: [PATCH] dump: add externLang attribute for tokens --- lib/tokenize.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index b64962752..992e2f51d 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -3018,7 +3018,7 @@ void Tokenizer::simplifyExternC() tok->linkAt(2)->deleteThis(); // } tok->deleteNext(2); // "C" { } else { - while ((tok2 = tok2->next()) && !Token::simpleMatch(tok2, ";")) + while ((tok2 = tok2->next()) && !Token::Match(tok2, "[;{]")) tok2->isExternC(true); tok->deleteNext(); // "C" } @@ -5247,6 +5247,8 @@ void Tokenizer::dump(std::ostream &out) const else if (tok->tokType() == Token::eLogicalOp) out << " isLogicalOp=\"true\""; } + if (tok->isExternC()) + out << " externLang=\"C\""; if (tok->isExpandedMacro()) out << " isExpandedMacro=\"true\""; if (tok->isRemovedVoidParameter())