Moved some parts to a static lib so both the executable and the tests can link to it.

Written additional tests.
This commit is contained in:
eelke 2017-02-26 19:29:50 +01:00
parent 0a809a7288
commit d0ea9dfa0c
39 changed files with 1767 additions and 493 deletions

View file

@ -133,7 +133,10 @@ void SqlSyntaxHighlighter::setTypes(const PgTypeContainer *types)
void SqlSyntaxHighlighter::highlightBlock(const QString &text)
{
SqlLexer lexer(text, LexerState::Null);
int previous_state = previousBlockState();
if (previous_state <= 0)
previous_state = 0;
SqlLexer lexer(text, (LexerState)previous_state);
int startpos, length;
BasicTokenType tokentype;
QString s;
@ -151,6 +154,9 @@ void SqlSyntaxHighlighter::highlightBlock(const QString &text)
setFormat(startpos, length, m_typeFormat);
}
break;
case BasicTokenType::OpenBlockComment:
setCurrentBlockState((int)lexer.currentState());
case BasicTokenType::BlockComment:
case BasicTokenType::Comment:
setFormat(startpos, length, m_commentFormat);
break;