File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -127,13 +127,18 @@ void Token::update_property_info()
127127 tokType (eVariable);
128128 else if (mTokensFrontBack .list .isKeyword (mStr )) {
129129 tokType (eKeyword);
130+ update_property_isStandardType ();
130131 setFlag (fIsControlFlowKeyword , controlFlowKeywords.find (mStr ) != controlFlowKeywords.end ());
131132 }
132133 else if (mStr == " asm" ) { // TODO: not a keyword
133134 tokType (eKeyword);
134135 }
135- else if (mTokType != eVariable && mTokType != eFunction && mTokType != eType && mTokType != eKeyword)
136+ // TODO: remove condition? appears to be (no longer necessary) protection for reset of varids in Tokenizer::setVarId()
137+ else if (mTokType != eVariable && mTokType != eFunction && mTokType != eType && mTokType != eKeyword) {
136138 tokType (eName);
139+ // some types are not being treated as keywords
140+ update_property_isStandardType ();
141+ }
137142 } else if (simplecpp::Token::isNumberLike (mStr )) {
138143 if ((MathLib::isInt (mStr ) || MathLib::isFloat (mStr )) && mStr .find (' _' ) == std::string::npos)
139144 tokType (eNumber);
@@ -174,8 +179,6 @@ void Token::update_property_info()
174179 tokType (eEllipsis);
175180 else
176181 tokType (eOther);
177-
178- update_property_isStandardType ();
179182 } else {
180183 tokType (eNone);
181184 }
Original file line number Diff line number Diff line change @@ -952,6 +952,9 @@ class CPPCHECKLIB Token {
952952 return mImpl ->mVarId ;
953953 }
954954 void varId (nonneg int id) {
955+ if (mImpl ->mVarId == id)
956+ return ;
957+
955958 mImpl ->mVarId = id;
956959 // TODO: remove special handling?
957960 if (id != 0 ) {
You can’t perform that action at this time.
0 commit comments