mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
sql parser refactor.
This commit is contained in:
@@ -103,6 +103,8 @@ public class SQLStatementParser extends SQLParser {
|
||||
case EOF:
|
||||
case END:
|
||||
case UNTIL:
|
||||
case ELSE:
|
||||
case WHEN:
|
||||
if (lexer.isKeepComments() && lexer.hasComment() && statementList.size() > 0) {
|
||||
SQLStatement stmt = statementList.get(statementList.size() - 1);
|
||||
stmt.addAfterComment(lexer.readAndResetComments());
|
||||
@@ -289,6 +291,12 @@ public class SQLStatementParser extends SQLParser {
|
||||
statementList.add(stmt);
|
||||
continue;
|
||||
}
|
||||
case LEAVE: {
|
||||
SQLStatement stmt = parseLeave();
|
||||
stmt.setParent(parent);
|
||||
statementList.add(stmt);
|
||||
continue;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -435,6 +443,10 @@ public class SQLStatementParser extends SQLParser {
|
||||
throw new ParserException("not supported. " + lexer.info());
|
||||
}
|
||||
|
||||
public SQLStatement parseLeave() {
|
||||
throw new ParserException("not supported. " + lexer.info());
|
||||
}
|
||||
|
||||
public SQLStatement parseReturn() {
|
||||
if (lexer.token() == Token.RETURN
|
||||
|| identifierEquals("RETURN")) {
|
||||
|
||||
Reference in New Issue
Block a user