-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encountered unexpected token: "\n\n\n" <ST_SEMICOLON> #1988
Comments
Greetings! Two empty lines If you still insist on empty lines then just use something like |
@manticore-projects Hello, I don't think it's that simple. Consider the following SQL statement, it cannot simply replace empty lines: update shop_info set title=?,
content='abc
def'
where id=? |
With JSQLParser 4.10 Snapshot, you can use the method @Test
void testSingleStatementWithEmptyLines() throws JSQLParserException {
String sqlStr = "update shop_info set title=?,\n"
+ "\n"
+ "\n"
+ "\n"
+ "content='abc\n"
+ "\n"
+ "\n"
+ "\n"
+ "def'\n"
+ "where id=?";
Statement statement = CCJSqlParserUtil.parse( CCJSqlParserUtil.sanitizeSingleSql( sqlStr) );
TestUtils.assertStatementCanBeDeparsedAs(statement, "update shop_info set title=?,\n"
+ "content='abc\n"
+ "\n"
+ "\n"
+ "\n"
+ "def'\n"
+ "where id=?", true);
} |
Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram
Failing SQL Feature:
SQL Example:
Software Information:
Tips:
Please write in English and avoid Screenshots (as we can't copy and paste content from it).
Try your example online with the latest JSQLParser and share the link in the error report.
Do provide Links or References to the specific Grammar and Syntax you are trying to use.
http://jsqlformatter.manticore-projects.com/jsqlformatter/demo.html?args=-c%20KoBQIgggKgogBAZwBYHsAOB9AlgOwGYpxwDKMUcALlhQDYCmAvAPwA0AUBx2gE7oLNEA6gAkYAJXhYAJsyA
The text was updated successfully, but these errors were encountered: