@@ -124,22 +124,22 @@ static std::string unquote(const std::string &s)
124124static std::vector<std::string> splitString (const std::string &line)
125125{
126126 std::vector<std::string> ret;
127- std::string::size_type pos1 = line.find_first_not_of (" " );
127+ std::string::size_type pos1 = line.find_first_not_of (' ' );
128128 while (pos1 < line.size ()) {
129129 std::string::size_type pos2;
130130 if (std::strchr (" *()" , line[pos1])) {
131131 ret.push_back (line.substr (pos1,1 ));
132- pos1 = line.find_first_not_of (" " , pos1 + 1 );
132+ pos1 = line.find_first_not_of (' ' , pos1 + 1 );
133133 continue ;
134134 }
135135 if (line[pos1] == ' <' )
136- pos2 = line.find (" > " , pos1);
136+ pos2 = line.find (' > ' , pos1);
137137 else if (line[pos1] == ' \" ' )
138- pos2 = line.find (" \" " , pos1+1 );
138+ pos2 = line.find (' \" ' , pos1+1 );
139139 else if (line[pos1] == ' \' ' ) {
140- pos2 = line.find (" \' " , pos1+1 );
140+ pos2 = line.find (' \' ' , pos1+1 );
141141 if (pos2 < (int )line.size () - 3 && line.compare (pos2, 3 , " \' :\' " , 0 , 3 ) == 0 )
142- pos2 = line.find (" \' " , pos2 + 3 );
142+ pos2 = line.find (' \' ' , pos2 + 3 );
143143 } else {
144144 pos2 = pos1;
145145 while (pos2 < line.size () && (line[pos2] == ' _' || line[pos2] == ' :' || std::isalnum ((unsigned char )line[pos2])))
@@ -159,21 +159,21 @@ static std::vector<std::string> splitString(const std::string &line)
159159 }
160160 }
161161
162- pos2 = line.find (" " , pos1) - 1 ;
162+ pos2 = line.find (' ' , pos1) - 1 ;
163163 if ((std::isalpha (line[pos1]) || line[pos1] == ' _' ) &&
164164 line.find (" ::" , pos1) < pos2 &&
165- line.find (" ::" , pos1) < line.find (" < " , pos1)) {
165+ line.find (" ::" , pos1) < line.find (' < ' , pos1)) {
166166 pos2 = line.find (" ::" , pos1);
167167 ret.push_back (line.substr (pos1, pos2-pos1));
168168 ret.emplace_back (" ::" );
169169 pos1 = pos2 + 2 ;
170170 continue ;
171171 }
172172 if ((std::isalpha (line[pos1]) || line[pos1] == ' _' ) &&
173- line.find (" < " , pos1) < pos2 &&
174- line.find (" <<" ,pos1) != line.find (" < " ,pos1) &&
175- line.find (" > " , pos1) != std::string::npos &&
176- line.find (" > " , pos1) > pos2) {
173+ line.find (' < ' , pos1) < pos2 &&
174+ line.find (" <<" ,pos1) != line.find (' < ' ,pos1) &&
175+ line.find (' > ' , pos1) != std::string::npos &&
176+ line.find (' > ' , pos1) > pos2) {
177177 int level = 0 ;
178178 for (pos2 = pos1; pos2 < line.size (); ++pos2) {
179179 if (line[pos2] == ' <' )
@@ -186,7 +186,7 @@ static std::vector<std::string> splitString(const std::string &line)
186186 }
187187 if (level > 1 && pos2 + 1 >= line.size ())
188188 return std::vector<std::string> {};
189- pos2 = line.find (" " , pos2);
189+ pos2 = line.find (' ' , pos2);
190190 if (pos2 != std::string::npos)
191191 --pos2;
192192 }
@@ -196,7 +196,7 @@ static std::vector<std::string> splitString(const std::string &line)
196196 break ;
197197 }
198198 ret.push_back (line.substr (pos1, pos2+1 -pos1));
199- pos1 = line.find_first_not_of (" " , pos2 + 1 );
199+ pos1 = line.find_first_not_of (' ' , pos2 + 1 );
200200 }
201201 return ret;
202202}
@@ -546,8 +546,8 @@ const ::Type * clangimport::AstNode::addTypeTokens(TokenList *tokenList, const s
546546
547547 std::string type;
548548 if (str.find (" (" ) != std::string::npos) {
549- if (str.find (" < " ) != std::string::npos)
550- type = str.substr (1 , str.find (" < " )) + " ...>" ;
549+ if (str.find (' < ' ) != std::string::npos)
550+ type = str.substr (1 , str.find (' < ' )) + " ...>" ;
551551 else
552552 type = str.substr (1 ,str.find (" (" )-1 );
553553 } else
@@ -557,8 +557,8 @@ const ::Type * clangimport::AstNode::addTypeTokens(TokenList *tokenList, const s
557557 type.erase (type.find (" (*)(" ));
558558 type += " *" ;
559559 }
560- if (type.find (" ( " ) != std::string::npos)
561- type.erase (type.find (" ( " ));
560+ if (type.find (' ( ' ) != std::string::npos)
561+ type.erase (type.find (' ( ' ));
562562
563563 std::stack<Token *> lpar;
564564 for (const std::string &s: splitString (type)) {
@@ -620,7 +620,7 @@ void clangimport::AstNode::setValueType(Token *tok)
620620 for (int i = 0 ; i < 2 ; i++) {
621621 const std::string &type = getType (i);
622622
623- if (type.find (" < " ) != std::string::npos)
623+ if (type.find (' < ' ) != std::string::npos)
624624 // TODO
625625 continue ;
626626
@@ -897,8 +897,8 @@ Token *clangimport::AstNode::createTokens(TokenList *tokenList)
897897 return newtok;
898898 }
899899 std::string type = getType ();
900- if (type.find (" * " ) != std::string::npos)
901- type = type.erase (type.rfind (" * " ));
900+ if (type.find (' * ' ) != std::string::npos)
901+ type = type.erase (type.rfind (' * ' ));
902902 addTypeTokens (tokenList, type);
903903 if (!children.empty ()) {
904904 Token *bracket1 = addtoken (tokenList, " [" );
@@ -1577,15 +1577,15 @@ void clangimport::parseClangAstDump(Tokenizer *tokenizer, std::istream &f)
15771577 std::string line;
15781578 std::vector<AstNodePtr> tree;
15791579 while (std::getline (f,line)) {
1580- const std::string::size_type pos1 = line.find (" - " );
1580+ const std::string::size_type pos1 = line.find (' - ' );
15811581 if (pos1 == std::string::npos)
15821582 continue ;
15831583 if (!tree.empty () && line.substr (pos1) == " -<<<NULL>>>" ) {
15841584 const int level = (pos1 - 1 ) / 2 ;
15851585 tree[level - 1 ]->children .push_back (nullptr );
15861586 continue ;
15871587 }
1588- const std::string::size_type pos2 = line.find (" " , pos1);
1588+ const std::string::size_type pos2 = line.find (' ' , pos1);
15891589 if (pos2 < pos1 + 4 || pos2 == std::string::npos)
15901590 continue ;
15911591 const std::string nodeType = line.substr (pos1+1 , pos2 - pos1 - 1 );
0 commit comments