Fixed some small details the analyzer was complaining about.

This commit is contained in:
eelke 2018-12-09 21:10:35 +01:00
parent e32c82ac6f
commit 9e645db1a8
7 changed files with 40 additions and 42 deletions

View file

@ -1,7 +1,7 @@
#include "SqlLexer.h"
SqlLexer::SqlLexer(const QString &block, LexerState currentstate)
: m_block(block)
SqlLexer::SqlLexer(QString block, LexerState currentstate)
: m_block(std::move(block))
, m_state(currentstate)
{}
@ -207,21 +207,20 @@ bool SqlLexer::parseSingleQuotedString(int startpos, int &length, BasicTokenType
tokentype = BasicTokenType::QuotedString;
return true;
}
else {
nextChar();
if (c == '\'') {
// maybe end of string literal
if (peekChar() == '\'') {
// Nope, just double quote to escape quote
nextChar(); // eat it
}
else {
length = m_pos - startpos;
tokentype = BasicTokenType::QuotedString;
return true;
}
}
}
nextChar();
if (c == '\'') {
// maybe end of string literal
if (peekChar() == '\'') {
// Nope, just double quote to escape quote
nextChar(); // eat it
}
else {
length = m_pos - startpos;
tokentype = BasicTokenType::QuotedString;
return true;
}
}
}
}
@ -236,21 +235,20 @@ bool SqlLexer::parseDoubleQuotedIdentifier(int startpos, int &length, BasicToken
tokentype = BasicTokenType::QuotedIdentifier;
return true;
}
else {
nextChar();
if (c == '"') {
// maybe end of string literal
if (peekChar() == '"') {
// Nope, just double quote to escape quote
nextChar(); // eat it
}
else {
length = m_pos - startpos;
tokentype = BasicTokenType::QuotedIdentifier;
return true;
}
}
}
nextChar();
if (c == '"') {
// maybe end of string literal
if (peekChar() == '"') {
// Nope, just double quote to escape quote
nextChar(); // eat it
}
else {
length = m_pos - startpos;
tokentype = BasicTokenType::QuotedIdentifier;
return true;
}
}
}
}