File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -256,9 +256,20 @@ QString identifier(antlr::RefAST ident)
256
256
ident->getType () == Sqlite3Lexer::QUOTEDLITERAL ||
257
257
ident->getType () == sqlite3TokenTypes::STRINGLITERAL)
258
258
{
259
+ // Remember the way the identifier is quoted
260
+ QChar quoteChar = sident.at (0 );
261
+
262
+ // Remove first and final character, i.e. the quotes
259
263
sident.remove (0 , 1 );
260
- sident.remove (sident.length () - 1 , 1 );
264
+ sident.chop (1 );
265
+
266
+ // Replace all remaining occurences of two succeeding quote characters and replace them
267
+ // by a single instance. This is done because two quotes can be used as a means of escaping
268
+ // the quote character, thus only the visual representation has its two quotes, the actual
269
+ // name contains only one.
270
+ sident.replace (QString (quoteChar) + quoteChar, quoteChar);
261
271
}
272
+
262
273
return sident;
263
274
}
264
275
You can’t perform that action at this time.
0 commit comments