@@ -103,14 +103,19 @@ static const std::unordered_set<std::string> controlFlowKeywords = {
103103void Token::update_property_info ()
104104{
105105 setFlag (fIsControlFlowKeyword , controlFlowKeywords.find (mStr ) != controlFlowKeywords.end ());
106+ isStandardType (false );
106107
107108 if (!mStr .empty ()) {
108109 if (mStr == " true" || mStr == " false" )
109110 tokType (eBoolean);
110- else if (isStringLiteral (mStr ))
111+ else if (isStringLiteral (mStr )) {
111112 tokType (eString);
112- else if (isCharLiteral (mStr ))
113+ isLong (isPrefixStringCharLiteral (mStr , ' "' , " L" ));
114+ }
115+ else if (isCharLiteral (mStr )) {
113116 tokType (eChar);
117+ isLong (isPrefixStringCharLiteral (mStr , ' \' ' , " L" ));
118+ }
114119 else if (std::isalpha ((unsigned char )mStr [0 ]) || mStr [0 ] == ' _' || mStr [0 ] == ' $' ) { // Name
115120 if (mImpl ->mVarId )
116121 tokType (eVariable);
@@ -157,12 +162,11 @@ void Token::update_property_info()
157162 tokType (eEllipsis);
158163 else
159164 tokType (eOther);
165+
166+ update_property_isStandardType ();
160167 } else {
161168 tokType (eNone);
162169 }
163-
164- update_property_char_string_literal ();
165- update_property_isStandardType ();
166170}
167171
168172static const std::unordered_set<std::string> stdTypes = { " bool"
@@ -180,9 +184,7 @@ static const std::unordered_set<std::string> stdTypes = { "bool"
180184
181185void Token::update_property_isStandardType ()
182186{
183- isStandardType (false );
184-
185- if (mStr .size () < 3 )
187+ if (mStr .size () < 3 || mStr .size () > 7 )
186188 return ;
187189
188190 if (stdTypes.find (mStr )!=stdTypes.end ()) {
@@ -191,15 +193,6 @@ void Token::update_property_isStandardType()
191193 }
192194}
193195
194- void Token::update_property_char_string_literal ()
195- {
196- if (mTokType != Token::eString && mTokType != Token::eChar)
197- return ;
198-
199- isLong (((mTokType == Token::eString) && isPrefixStringCharLiteral (mStr , ' "' , " L" )) ||
200- ((mTokType == Token::eChar) && isPrefixStringCharLiteral (mStr , ' \' ' , " L" )));
201- }
202-
203196bool Token::isUpperCaseName () const
204197{
205198 if (!isName ())
0 commit comments