Skip to content

Commit 678c291

Browse files
committed
Move parentheses check to other select-related rules
1 parent e28daae commit 678c291

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/org/firebirdsql/jaybird/parser/StatementDetector.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public final class StatementDetector implements TokenVisitor {
4747
// NOTE: This is a shortcut, if WITH is ever allowed as the first token of another statement type,
4848
// this must be changed to detect the first keyword after the entire WITH clause
4949
nextAfterStart.put("WITH", selectState);
50+
// Firebird 5.0+ parenthesized query expression
51+
// NOTE: This is a shortcut, if parenthesis at the top-level are ever allowed for anything other than SELECT (or
52+
// SELECT-like statements), this needs to be reworked
53+
nextAfterStart.put("(", selectState);
5054
nextAfterStart.put("EXECUTE", new StateAfterStart(ParserState.EXECUTE, LocalStatementType.OTHER));
5155
nextAfterStart.put("UPDATE", new StateAfterStart(ParserState.UPDATE, LocalStatementType.UPDATE));
5256
nextAfterStart.put("DELETE", new StateAfterStart(ParserState.DELETE, LocalStatementType.DELETE));
@@ -56,10 +60,6 @@ public final class StatementDetector implements TokenVisitor {
5660
nextAfterStart.put("ROLLBACK",
5761
new StateAfterStart(ParserState.COMMIT_ROLLBACK, LocalStatementType.HARD_ROLLBACK));
5862
nextAfterStart.put("SET", new StateAfterStart(ParserState.SET, LocalStatementType.OTHER));
59-
// Firebird 5.0+ parenthesized query expression
60-
// NOTE: This is a shortcut, if parenthesis at the top-level are ever allowed for anything other than SELECT (or
61-
// SELECT-like statements), this needs to be reworked
62-
nextAfterStart.put("(", new StateAfterStart(ParserState.SELECT, LocalStatementType.SELECT));
6363
// Firebird 6.0+ USING ... DO; need to find end of the USING clause to detect actual statement type
6464
nextAfterStart.put("USING", new StateAfterStart(ParserState.FIND_USING_END, LocalStatementType.OTHER));
6565
// Firebird 6.0+ CALL

0 commit comments

Comments
 (0)