Skip to content
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

Add Optional NOT to function expression #639

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ binary_and_expr ::= expr AND expr {
binary_or_expr ::= expr OR expr {
implements = "com.alecstrong.sql.psi.core.psi.SqlBinaryExpr"
}
function_expr ::= function_name LP [ [ DISTINCT ] expr ( ( COMMA | FROM | FOR | SEPARATOR ) expr ) * | MULTIPLY ] RP
function_expr ::= [ NOT ] function_name LP [ [ DISTINCT ] expr ( ( COMMA | FROM | FOR | SEPARATOR ) expr ) * | MULTIPLY ] RP
paren_expr ::= LP expr RP {
pin = 1
}
Expand Down
15 changes: 15 additions & 0 deletions core/src/testFixtures/resources/fixtures/not-function-expr/Test.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE test (
test_id INTEGER
);

SELECT
test_id
FROM
test
GROUP BY
test_id
HAVING
NOT COALESCE(TRUE, FALSE);

SELECT NOT COALESCE(TRUE, FALSE) FROM test;