Improved generation of c/cpp string from query

Extra lines before and after query are removed. Whitespace at end of line
is removed. SQL comments are converted to cpp style comments and are outside
the string literal.

To achieve this the function now uses the SQLLexer to know what is comment.
This also required the additional capability in the lexer to also return whitespace and newline tokens.
Also a few bugs in the lexer were fixed.
This commit is contained in:
eelke 2019-08-19 13:52:23 +02:00
parent fbd630489e
commit 48ac8c6bab
7 changed files with 247 additions and 34 deletions

View file

@ -60,4 +60,3 @@ TEST(ConvertLangToSqlString, testSemiColon)
auto output = ConvertLangToSqlString(in);
ASSERT_EQ(output, expected);
}