Qt6 migration

This commit is contained in:
eelke 2021-03-06 13:13:31 +01:00
parent 87553b2554
commit 423043d431
19 changed files with 64 additions and 87 deletions

View file

@ -100,8 +100,7 @@ bool SqlLexer::nextBasicToken(int &startpos, int &length, BasicTokenType &tokent
}
length = m_pos - startpos;
tokentype = BasicTokenType::WhiteSpace;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
out = m_block.mid(startpos, length);
return true;
}
}
@ -117,8 +116,7 @@ bool SqlLexer::nextBasicToken(int &startpos, int &length, BasicTokenType &tokent
}
length = m_pos - startpos;
tokentype = BasicTokenType::Comment;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
out = m_block.mid(startpos, length);
return true;
}
else if (c == ':') {
@ -127,9 +125,8 @@ bool SqlLexer::nextBasicToken(int &startpos, int &length, BasicTokenType &tokent
nextChar();
length = m_pos - startpos;
tokentype = BasicTokenType::Cast;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
return true;
out = m_block.mid(startpos, length);
return true;
}
}
else if (isSelf(c)) {
@ -139,9 +136,8 @@ bool SqlLexer::nextBasicToken(int &startpos, int &length, BasicTokenType &tokent
else
tokentype = BasicTokenType::Self;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
return true;
out = m_block.mid(startpos, length);
return true;
}
else if (isOperatorChar(c)) {
while (true) {
@ -153,27 +149,24 @@ bool SqlLexer::nextBasicToken(int &startpos, int &length, BasicTokenType &tokent
// unexpected end, pretend nothings wrong
length = m_pos - startpos;
tokentype = BasicTokenType::Operator;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
return true;
out = m_block.mid(startpos, length);
return true;
}
}
}
else if (c == '\'') {
// Single quoted string so it's an SQL text literal
if (parseSingleQuotedString(startpos, length, tokentype)) {
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
return true;
out = m_block.mid(startpos, length);
return true;
}
return false;
}
else if (c == '"') {
// Double quoted identifier
if (parseDoubleQuotedIdentifier(startpos, length, tokentype)) {
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
return true;
out = m_block.mid(startpos, length);
return true;
}
return false;
}
@ -200,9 +193,8 @@ bool SqlLexer::nextBasicToken(int &startpos, int &length, BasicTokenType &tokent
}
length = m_pos - startpos;
tokentype = BasicTokenType::Symbol;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
return true;
out = m_block.mid(startpos, length);
return true;
}
// }
// else if (LexerState::InBlockComment == m_state) {
@ -301,8 +293,7 @@ bool SqlLexer::parseDollarQuote(int startpos, int &length, BasicTokenType &token
}
tokentype = BasicTokenType::Parameter;
length = m_pos - startpos;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
out = m_block.mid(startpos, length);
return true;
}
@ -314,8 +305,7 @@ bool SqlLexer::parseDollarQuote(int startpos, int &length, BasicTokenType &token
// Found valid dollar quote
tokentype = BasicTokenType::DollarQuote;
length = m_pos - startpos;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
out = m_block.mid(startpos, length);
return true;
}
@ -323,8 +313,7 @@ bool SqlLexer::parseDollarQuote(int startpos, int &length, BasicTokenType &token
// ERROR, unallowed character
tokentype = BasicTokenType::None;
length = m_pos - startpos;
QStringRef sr(&m_block, startpos, length);
out = sr.toString();
out = m_block.mid(startpos, length);
return false;
}
}