diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index 2e86d3449..b98d5a920 100755 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -118,6 +118,7 @@ class Token: isLogicalOp Is this token a logical operator: && || isUnsigned Is this token a unsigned type isSigned Is this token a signed type + isExpandedMacro Is this token a expanded macro token varId varId for token, each variable has a unique non-zero id variable Variable information for this token. See the Variable class. function If this token points at a function call, this attribute has the Function @@ -165,6 +166,7 @@ class Token: isLogicalOp = False isUnsigned = False isSigned = False + isExpandedMacro = False varId = None variableId = None variable = None @@ -223,6 +225,8 @@ class Token: self.isComparisonOp = True elif element.get('isLogicalOp'): self.isLogicalOp = True + if element.get('isExpandedMacro'): + self.isExpandedMacro = True self.linkId = element.get('link') self.link = None if element.get('varId'): diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index a9c731620..cc2dc4b40 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4860,6 +4860,8 @@ void Tokenizer::dump(std::ostream &out) const else if (tok->tokType() == Token::eLogicalOp) out << " isLogicalOp=\"True\""; } + if (tok->isExpandedMacro()) + out << " isExpandedMacro=\"True\""; if (tok->link()) out << " link=\"" << tok->link() << '\"'; if (tok->varId() > 0)