- Timestamp:
- 07/29/18 19:58:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/rootifysql.cc
r19093 r19094 137 137 vector<string> queries; 138 138 139 string resub(string str , size_t indent)139 string resub(string str) 140 140 { 141 141 // search for "KEYWORD expression" … … 152 152 const auto idx = atoi(arg.c_str()+1); 153 153 154 str.replace(pos, len, resub(vec[idx] , indent));154 str.replace(pos, len, resub(vec[idx])); 155 155 } 156 156 … … 175 175 if (vec[idx].substr(0,2)=="({") 176 176 { 177 cout << setw(indent) << ' ' << "(" << resub(vec[idx] , indent+4) << ") ";177 cout << setw(indent) << ' ' << "(" << resub(vec[idx]) << ") "; 178 178 } 179 179 else … … 181 181 if (indent>0) 182 182 cout << setw(indent) << ' '; 183 cout << vec[idx];183 cout << resub(vec[idx]); 184 184 } 185 185 } … … 188 188 if (indent>0) 189 189 cout << setw(indent) << ' '; 190 cout << expr;190 cout << resub(expr); 191 191 } 192 192 } … … 199 199 const string _com = "\\/\\*\\ select\\#[0-9]+\\ \\*\\/\\ *"; 200 200 201 const string _tok = "[a-zA-Z ]+";201 const string _tok = "[a-zA-Z_ ]+"; 202 202 203 203 const string _nnn = "\\{[0-9]+\\}|[0-9]+"; … … 261 261 262 262 // substitute all paranthesis 263 sql = substitute(sql, " \\([^\\(\\)]*\\)");263 sql = substitute(sql, "[a-zA-Z0-9_]*\\([^\\(\\)]*\\)"); 264 264 265 265 //cout << sql << "\n\n";
Note:
See TracChangeset
for help on using the changeset viewer.