From b8da4d3e080b66b441569bf0b29661e670e5b79e Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Thu, 29 May 2025 21:17:03 -0400 Subject: [PATCH] parser: fix more pg test suite errors --- .../src/generated/syntax_kind.rs | 5 + crates/squawk_parser/src/grammar.rs | 153 ++--- .../tests__create_event_trigger_ok.snap | 41 +- .../tests/snapshots/tests__grant_ok.snap | 18 +- .../snapshots/tests__regression_arrays.snap | 483 --------------- .../tests__regression_collate.icu.utf8.snap | 5 +- .../tests__regression_collate.linux.utf8.snap | 3 - .../snapshots/tests__regression_collate.snap | 7 - .../tests__regression_create_misc.snap | 6 - .../tests__regression_create_role.snap | 8 - .../tests__regression_create_schema.snap | 7 - .../tests__regression_create_table_like.snap | 5 - .../tests__regression_create_type.snap | 5 - .../snapshots/tests__regression_domain.snap | 171 +---- .../tests__regression_event_trigger.snap | 11 - .../tests__regression_fast_default.snap | 10 - .../tests__regression_generated_stored.snap | 27 - .../tests__regression_generated_virtual.snap | 582 +----------------- .../tests__regression_incremental_sort.snap | 5 - .../snapshots/tests__regression_inherit.snap | 3 - .../tests__regression_insert_conflict.snap | 7 - .../snapshots/tests__regression_int2.snap | 6 - .../snapshots/tests__regression_int4.snap | 8 - .../snapshots/tests__regression_int8.snap | 12 - .../snapshots/tests__regression_join.snap | 1 - .../snapshots/tests__regression_jsonb.snap | 35 -- .../snapshots/tests__regression_limit.snap | 11 - .../snapshots/tests__regression_numeric.snap | 8 - .../tests__regression_partition_prune.snap | 1 - .../tests__regression_privileges.snap | 36 +- .../snapshots/tests__regression_psql.snap | 119 ++-- .../tests__regression_publication.snap | 20 - .../tests__regression_rowsecurity.snap | 9 - .../snapshots/tests__regression_rowtypes.snap | 38 -- .../snapshots/tests__regression_rules.snap | 26 - .../tests__regression_select_into.snap | 1 - .../tests__regression_select_parallel.snap | 1 - .../tests__regression_stats_ext.snap | 8 - .../tests__regression_subselect.snap | 2 - .../tests__regression_suite_errors.snap | 63 +- .../snapshots/tests__regression_union.snap | 26 - .../tests__regression_updatable_views.snap | 8 - .../snapshots/tests__regression_update.snap | 17 - .../tests__regression_write_parallel.snap | 5 - .../tests/snapshots/tests__select_ok.snap | 47 +- .../squawk_syntax/src/ast/generated/nodes.rs | 292 ++++++++- crates/squawk_syntax/src/postgresql.ungram | 4 + 47 files changed, 510 insertions(+), 1856 deletions(-) delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_collate.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_create_misc.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_create_role.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_create_schema.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_create_type.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_event_trigger.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_fast_default.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_incremental_sort.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_int2.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_int4.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_int8.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_limit.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_rowtypes.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_updatable_views.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_write_parallel.snap diff --git a/crates/squawk_parser/src/generated/syntax_kind.rs b/crates/squawk_parser/src/generated/syntax_kind.rs index fb0ce1e3..10dd19e9 100644 --- a/crates/squawk_parser/src/generated/syntax_kind.rs +++ b/crates/squawk_parser/src/generated/syntax_kind.rs @@ -754,6 +754,7 @@ pub enum SyntaxKind { EXPR, FAT_ARROW, FETCH, + FETCH_CLAUSE, FIELD_EXPR, FILTER_CLAUSE, FORCE_RLS, @@ -802,6 +803,10 @@ pub enum SyntaxKind { LOCK, LOCKING_CLAUSE, LTEQ, + MATCH_FULL, + MATCH_PARTIAL, + MATCH_SIMPLE, + MATCH_TYPE, MERGE, MOVE, NAME, diff --git a/crates/squawk_parser/src/grammar.rs b/crates/squawk_parser/src/grammar.rs index f8967add..f7df0190 100644 --- a/crates/squawk_parser/src/grammar.rs +++ b/crates/squawk_parser/src/grammar.rs @@ -1259,6 +1259,7 @@ fn lhs(p: &mut Parser<'_>, r: &Restrictions) -> Option { } p.expect(AS_KW); type_name(p); + opt_collate(p); p.expect(R_PAREN); let cm = m.complete(p, CAST_EXPR); return Some(cm); @@ -1311,6 +1312,12 @@ fn postfix_expr( lhs = m.complete(p, POSTFIX_EXPR); break; } + NOTNULL_KW => { + let m = lhs.precede(p); + p.bump(NOTNULL_KW); + lhs = m.complete(p, POSTFIX_EXPR); + break; + } _ => break, }; } @@ -1459,12 +1466,12 @@ fn path_for_qualifier( } fn opt_percent_type(p: &mut Parser<'_>) -> Option { - let m = p.start(); - if p.eat(PERCENT) { - p.expect(TYPE_KW); + if p.at(PERCENT) && p.nth_at(1, TYPE_KW) { + let m = p.start(); + p.bump(PERCENT); + p.bump(TYPE_KW); Some(m.complete(p, PERCENT_TYPE_CLAUSE)) } else { - m.abandon(p); None } } @@ -1603,9 +1610,9 @@ fn opt_type_name_with(p: &mut Parser<'_>, type_args_enabled: bool) -> Option { + DOUBLE_KW if p.nth_at(1, PRECISION_KW) => { p.bump(DOUBLE_KW); - p.expect(PRECISION_KW); + p.bump(PRECISION_KW); DOUBLE_TYPE } _ if p.at_ts(TYPE_KEYWORDS) || p.at(IDENT) => { @@ -2383,7 +2390,9 @@ fn select(p: &mut Parser, m: Option) -> Option { } opt_limit_clause(p); opt_offset_clause(p); + opt_limit_clause(p); opt_fetch_clause(p); + opt_offset_clause(p); if !has_locking_clause { while p.at(FOR_KW) { opt_locking_clause(p); @@ -2449,18 +2458,18 @@ fn opt_locking_clause(p: &mut Parser<'_>) -> Option { } // FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES } -fn opt_fetch_clause(p: &mut Parser<'_>) -> bool { - if !p.eat(FETCH_KW) { - return false; +fn opt_fetch_clause(p: &mut Parser<'_>) -> Option { + if !p.at(FETCH_KW) { + return None; } + let m = p.start(); + p.bump(FETCH_KW); // { FIRST | NEXT } - if p.at(FIRST_KW) || p.at(NEXT_KW) { - p.bump_any(); - } else { + if !p.eat(FIRST_KW) && !p.eat(NEXT_KW) { p.error("expected first or next"); } // [ count ] - if expr(p).is_none() { + if !p.at(ROWS_KW) && !p.at(ROW_KW) && expr(p).is_none() { p.error("expected an expression"); } // { ROW | ROWS } @@ -2473,7 +2482,7 @@ fn opt_fetch_clause(p: &mut Parser<'_>) -> bool { } else { p.expect(ONLY_KW); } - true + Some(m.complete(p, FETCH_CLAUSE)) } fn opt_order_by_clause(p: &mut Parser<'_>) -> bool { @@ -3280,7 +3289,9 @@ fn opt_constraint_inner(p: &mut Parser<'_>) -> Option { p.error("expected an expression"); } p.expect(R_PAREN); - p.expect(STORED_KW); + if !p.eat(STORED_KW) && !p.eat(VIRTUAL_KW) { + p.error("expected STORED or VIRTUAL"); + } GENERATED_CONSTRAINT // { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] } else if p.at(ALWAYS_KW) || p.at(BY_KW) { @@ -3820,25 +3831,24 @@ fn opt_alias(p: &mut Parser<'_>) -> Option { Some(m.complete(p, ALIAS)) } -fn opt_where_clause(p: &mut Parser<'_>) -> bool { +fn opt_where_clause(p: &mut Parser<'_>) -> Option { if !p.at(WHERE_KW) { - return false; + return None; } let m = p.start(); p.bump(WHERE_KW); if expr(p).is_none() { p.error("expected an expression"); } - m.complete(p, WHERE_CLAUSE); - true + Some(m.complete(p, WHERE_CLAUSE)) } /// -fn opt_group_by_clause(p: &mut Parser<'_>) -> bool { +fn opt_group_by_clause(p: &mut Parser<'_>) -> Option { let m = p.start(); if !p.eat(GROUP_KW) { m.abandon(p); - return false; + return None; } p.expect(BY_KW); if p.at(ALL_KW) || p.at(DISTINCT_KW) { @@ -3864,22 +3874,20 @@ fn opt_group_by_clause(p: &mut Parser<'_>) -> bool { break; } } - m.complete(p, GROUP_BY_CLAUSE); - true + Some(m.complete(p, GROUP_BY_CLAUSE)) } /// -fn opt_having_clause(p: &mut Parser<'_>) -> bool { +fn opt_having_clause(p: &mut Parser<'_>) -> Option { if !p.at(HAVING_KW) { - return false; + return None; } let m = p.start(); p.bump(HAVING_KW); if expr(p).is_none() { p.error("expected an expression"); } - m.complete(p, HAVING_CLAUSE); - true + Some(m.complete(p, HAVING_CLAUSE)) } // frame_start and frame_end can be one of @@ -3943,9 +3951,9 @@ const WINDOW_DEF_START: TokenSet = // The frame_clause can be one of // { RANGE | ROWS | GROUPS } frame_start [ frame_exclusion ] // { RANGE | ROWS | GROUPS } BETWEEN frame_start AND frame_end [ frame_exclusion ] -fn window_definition(p: &mut Parser<'_>) -> bool { +fn window_definition(p: &mut Parser<'_>) -> Option { if !p.at_ts(WINDOW_DEF_START) { - return false; + return None; } let m = p.start(); p.eat(IDENT); @@ -3973,14 +3981,13 @@ fn window_definition(p: &mut Parser<'_>) -> bool { opt_frame_exclusion(p); } } - m.complete(p, WINDOW_DEF); - true + Some(m.complete(p, WINDOW_DEF)) } /// -fn opt_window_clause(p: &mut Parser<'_>) -> bool { +fn opt_window_clause(p: &mut Parser<'_>) -> Option { if !p.at(WINDOW_KW) { - return false; + return None; } let m = p.start(); p.bump(WINDOW_KW); @@ -3989,39 +3996,36 @@ fn opt_window_clause(p: &mut Parser<'_>) -> bool { p.expect(L_PAREN); window_definition(p); p.expect(R_PAREN); - m.complete(p, WINDOW_CLAUSE); - true + Some(m.complete(p, WINDOW_CLAUSE)) } // [ LIMIT { count | ALL } ] -fn opt_limit_clause(p: &mut Parser<'_>) -> bool { +fn opt_limit_clause(p: &mut Parser<'_>) -> Option { let m = p.start(); if !p.eat(LIMIT_KW) { m.abandon(p); - return false; + return None; } if !p.eat(ALL_KW) && expr(p).is_none() { p.error("expected an expression"); } - m.complete(p, LIMIT_CLAUSE); - true + Some(m.complete(p, LIMIT_CLAUSE)) } // [ OFFSET start [ ROW | ROWS ] ] -fn opt_offset_clause(p: &mut Parser<'_>) -> bool { - let m = p.start(); - if !p.eat(OFFSET_KW) { - m.abandon(p); - return false; +fn opt_offset_clause(p: &mut Parser<'_>) -> Option { + if !p.at(OFFSET_KW) { + return None; } + let m = p.start(); + p.bump(OFFSET_KW); if expr(p).is_none() { p.error("expected an expression"); } if p.at(ROW_KW) || p.at(ROWS_KW) { p.bump_any(); } - m.complete(p, OFFSET_CLAUSE); - true + Some(m.complete(p, OFFSET_CLAUSE)) } /// all is the default, distinct removes duplicate rows @@ -8023,9 +8027,8 @@ fn create_event_trigger(p: &mut Parser<'_>) -> CompletedMarker { if !p.eat(FUNCTION_KW) && !p.eat(PROCEDURE_KW) { p.error("expected FUNCTION or PROCEDURE"); } - path_name_ref(p); - p.expect(L_PAREN); - p.expect(R_PAREN); + // TODO: add validation to prevent passing arguments here + call_expr(p); m.complete(p, CREATE_EVENT_TRIGGER) } @@ -9665,6 +9668,8 @@ fn explain(p: &mut Parser<'_>) -> CompletedMarker { if let Some(statement) = statement { match statement.kind() { SELECT + | COMPOUND_SELECT + | SELECT_INTO | VALUES | INSERT | UPDATE @@ -10070,24 +10075,32 @@ fn grant(p: &mut Parser<'_>) -> CompletedMarker { // [ WITH GRANT OPTION ] // [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ] if p.eat(WITH_KW) { - match p.current() { - ADMIN_KW | INHERIT_KW | SET_KW => { - p.bump_any(); - if !(p.eat(OPTION_KW) || p.eat(TRUE_KW) || p.eat(FALSE_KW)) { - p.error("expected OPTION, TRUE, or FALSE") - } - } - GRANT_KW => { - p.bump(GRANT_KW); - p.expect(OPTION_KW); - } - _ => p.error("expected WITH GRANT OPTION or WITH ADMIN/INHERIT/SET OPTION/TRUE/FALSE"), - } + grant_role_option_list(p); } opt_granted_by(p); m.complete(p, GRANT) } +fn grant_role_option_list(p: &mut Parser<'_>) { + if p.eat(GRANT_KW) { + p.expect(OPTION_KW); + return; + } + while p.at_ts(COL_LABEL_FIRST) { + col_label(p); + if !(p.eat(OPTION_KW) || p.eat(TRUE_KW) || p.eat(FALSE_KW)) { + p.error("expected OPTION, TRUE, or FALSE") + } + if !p.eat(COMMA) { + if p.at_ts(COL_LABEL_FIRST) { + p.error("missing comma"); + } else { + break; + } + } + } +} + fn privilege_target(p: &mut Parser<'_>) { if p.eat(ALL_KW) { match p.current() { @@ -10746,7 +10759,7 @@ fn create_view(p: &mut Parser<'_>) -> CompletedMarker { }, ) { Some(statement) => match statement.kind() { - SELECT | COMPOUND_SELECT => (), + SELECT | COMPOUND_SELECT | SELECT_INTO => (), kind => p.error(format!("expected SELECT, got {:?}", kind)), }, None => p.error("expected SELECT"), @@ -10799,7 +10812,9 @@ fn prepare(p: &mut Parser<'_>) -> CompletedMarker { ); if let Some(statement) = statement { match statement.kind() { - SELECT | VALUES | INSERT | UPDATE | DELETE | MERGE => (), + SELECT | COMPOUND_SELECT | SELECT_INTO | VALUES | INSERT | UPDATE | DELETE | MERGE => { + () + } kind => { p.error(format!( "expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got {:?}", @@ -11482,15 +11497,15 @@ fn opt_schema_elements(p: &mut Parser<'_>) { } (CREATE_KW, VIEW_KW) => { create_view(p); - return; } (CREATE_KW, SEQUENCE_KW) => { create_sequence(p); - return; } (CREATE_KW, TRIGGER_KW) => { create_trigger(p); - return; + } + (CREATE_KW, INDEX_KW) => { + create_index(p); } _ => return, }; @@ -11657,7 +11672,7 @@ fn set_clause(p: &mut Parser<'_>) { // ( column_name [, ...] ) = ( sub-SELECT ) if p.eat(L_PAREN) { while !p.at(EOF) { - name_ref(p); + name_ref(p).map(|lhs| postfix_expr(p, lhs, true)); if !p.eat(COMMA) { break; } @@ -11688,7 +11703,7 @@ fn set_clause(p: &mut Parser<'_>) { } // column_name = { expression | DEFAULT } } else { - name_ref(p); + name_ref(p).map(|lhs| postfix_expr(p, lhs, true)); p.expect(EQ); // { expression | DEFAULT } if !p.eat(DEFAULT_KW) && expr(p).is_none() { diff --git a/crates/squawk_parser/tests/snapshots/tests__create_event_trigger_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_event_trigger_ok.snap index 51a52700..309a5081 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_event_trigger_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_event_trigger_ok.snap @@ -23,12 +23,12 @@ SOURCE_FILE WHITESPACE " " FUNCTION_KW "function" WHITESPACE " " - PATH - PATH_SEGMENT - NAME_REF - IDENT "f" - L_PAREN "(" - R_PAREN ")" + CALL_EXPR + NAME_REF + IDENT "f" + ARG_LIST + L_PAREN "(" + R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- full" @@ -83,17 +83,16 @@ SOURCE_FILE WHITESPACE " " FUNCTION_KW "function" WHITESPACE " " - PATH - PATH - PATH_SEGMENT - NAME_REF - IDENT "foo" - DOT "." - PATH_SEGMENT + CALL_EXPR + FIELD_EXPR + NAME_REF + IDENT "foo" + DOT "." NAME_REF IDENT "f" - L_PAREN "(" - R_PAREN ")" + ARG_LIST + L_PAREN "(" + R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- doc_example_1" @@ -116,11 +115,11 @@ SOURCE_FILE WHITESPACE " " FUNCTION_KW "FUNCTION" WHITESPACE " " - PATH - PATH_SEGMENT - NAME_REF - IDENT "abort_any_command" - L_PAREN "(" - R_PAREN ")" + CALL_EXPR + NAME_REF + IDENT "abort_any_command" + ARG_LIST + L_PAREN "(" + R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__grant_ok.snap b/crates/squawk_parser/tests/snapshots/tests__grant_ok.snap index 2ac0f6e5..b381b907 100644 --- a/crates/squawk_parser/tests/snapshots/tests__grant_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__grant_ok.snap @@ -1288,7 +1288,8 @@ SOURCE_FILE WHITESPACE "\n " WITH_KW "with" WHITESPACE " " - SET_KW "set" + NAME + SET_KW "set" WHITESPACE " " OPTION_KW "option" SEMICOLON ";" @@ -1541,7 +1542,8 @@ SOURCE_FILE WHITESPACE "\n " WITH_KW "with" WHITESPACE " " - ADMIN_KW "admin" + NAME + ADMIN_KW "admin" WHITESPACE " " OPTION_KW "option" SEMICOLON ";" @@ -1557,7 +1559,8 @@ SOURCE_FILE WHITESPACE "\n " WITH_KW "with" WHITESPACE " " - INHERIT_KW "inherit" + NAME + INHERIT_KW "inherit" WHITESPACE " " OPTION_KW "option" SEMICOLON ";" @@ -1573,7 +1576,8 @@ SOURCE_FILE WHITESPACE "\n " WITH_KW "with" WHITESPACE " " - INHERIT_KW "inherit" + NAME + INHERIT_KW "inherit" WHITESPACE " " TRUE_KW "true" SEMICOLON ";" @@ -1589,7 +1593,8 @@ SOURCE_FILE WHITESPACE "\n " WITH_KW "with" WHITESPACE " " - SET_KW "set" + NAME + SET_KW "set" WHITESPACE " " FALSE_KW "false" SEMICOLON ";" @@ -1619,7 +1624,8 @@ SOURCE_FILE WHITESPACE "\n " WITH_KW "with" WHITESPACE " " - SET_KW "set" + NAME + SET_KW "set" WHITESPACE " " OPTION_KW "option" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap b/crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap index 92b7708e..9d6d5bb4 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_arrays.snap @@ -2,491 +2,8 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/arrays.sql --- -ERROR@564: expected EQ -ERROR@598: expected EQ -ERROR@1731: expected EQ -ERROR@1733: expected COMMA -ERROR@1733: expected R_BRACK -ERROR@1733: expected SEMICOLON -ERROR@1733: expected command, found COLON -ERROR@1734: expected command, found INT_NUMBER -ERROR@1735: expected command, found R_BRACK -ERROR@1737: expected command, found EQ -ERROR@1739: expected command, found STRING -ERROR@1751: expected command, found WHERE_KW -ERROR@1757: expected command, found NOT_KW -ERROR@1761: expected command, found IDENT -ERROR@1763: expected command, found EQ -ERROR@1765: expected command, found STRING -ERROR@1769: expected command, found COLON -ERROR@1770: expected command, found COLON -ERROR@1771: expected command, found IDENT -ERROR@1801: expected EQ -ERROR@1803: expected COMMA -ERROR@1803: expected R_BRACK -ERROR@1803: expected SEMICOLON -ERROR@1803: expected command, found COLON -ERROR@1804: expected command, found INT_NUMBER -ERROR@1805: expected command, found R_BRACK -ERROR@1806: expected command, found L_BRACK -ERROR@1807: expected command, found INT_NUMBER -ERROR@1808: expected command, found COLON -ERROR@1809: expected command, found INT_NUMBER -ERROR@1810: expected command, found R_BRACK -ERROR@1811: expected command, found L_BRACK -ERROR@1812: expected command, found INT_NUMBER -ERROR@1813: expected command, found COLON -ERROR@1814: expected command, found INT_NUMBER -ERROR@1815: expected command, found R_BRACK -ERROR@1817: expected command, found EQ -ERROR@1819: expected command, found STRING -ERROR@1831: expected command, found COMMA -ERROR@1839: expected command, found IDENT -ERROR@1840: expected command, found L_BRACK -ERROR@1841: expected command, found INT_NUMBER -ERROR@1842: expected command, found COLON -ERROR@1843: expected command, found INT_NUMBER -ERROR@1844: expected command, found R_BRACK -ERROR@1845: expected command, found L_BRACK -ERROR@1846: expected command, found INT_NUMBER -ERROR@1847: expected command, found COLON -ERROR@1848: expected command, found INT_NUMBER -ERROR@1849: expected command, found R_BRACK -ERROR@1850: expected command, found L_BRACK -ERROR@1851: expected command, found INT_NUMBER -ERROR@1852: expected command, found COLON -ERROR@1853: expected command, found INT_NUMBER -ERROR@1854: expected command, found R_BRACK -ERROR@1856: expected command, found EQ -ERROR@1858: expected command, found STRING -ERROR@1873: expected command, found WHERE_KW -ERROR@1879: expected command, found IDENT -ERROR@1889: expected command, found L_PAREN -ERROR@1890: expected command, found IDENT -ERROR@1891: expected command, found R_PAREN -ERROR@1893: expected command, found EQ -ERROR@1895: expected command, found STRING -ERROR@1937: expected EQ -ERROR@1939: expected COMMA -ERROR@1939: expected R_BRACK -ERROR@1939: expected SEMICOLON -ERROR@1939: expected command, found COLON -ERROR@1940: expected command, found INT_NUMBER -ERROR@1941: expected command, found R_BRACK -ERROR@1943: expected command, found EQ -ERROR@1945: expected command, found STRING -ERROR@1962: expected command, found WHERE_KW -ERROR@1968: expected command, found IDENT -ERROR@1978: expected command, found L_PAREN -ERROR@1979: expected command, found IDENT -ERROR@1980: expected command, found R_PAREN -ERROR@1982: expected command, found IS_KW -ERROR@1985: expected command, found NOT_KW -ERROR@1989: expected command, found NULL_KW -ERROR@2269: expected EQ -ERROR@3326: expected EQ -ERROR@3412: expected EQ -ERROR@3417: expected COMMA -ERROR@3417: expected R_BRACK -ERROR@3417: expected SEMICOLON -ERROR@3417: expected command, found COLON -ERROR@3418: expected command, found INT_NUMBER -ERROR@3419: expected command, found R_BRACK -ERROR@3421: expected command, found EQ -ERROR@3423: expected command, found STRING -ERROR@3445: expected command, found WHERE_KW -ERROR@3451: expected command, found IDENT -ERROR@3461: expected command, found L_PAREN -ERROR@3462: expected command, found IDENT -ERROR@3463: expected command, found R_PAREN -ERROR@3465: expected command, found IS_KW -ERROR@3468: expected command, found NOT_KW -ERROR@3472: expected command, found NULL_KW -ERROR@3500: expected EQ -ERROR@3502: expected COMMA -ERROR@3502: expected R_BRACK -ERROR@3502: expected SEMICOLON -ERROR@3502: expected command, found COLON -ERROR@3503: expected command, found NULL_KW -ERROR@3507: expected command, found R_BRACK -ERROR@3509: expected command, found EQ -ERROR@3511: expected command, found STRING -ERROR@3533: expected command, found WHERE_KW -ERROR@3539: expected command, found IDENT -ERROR@3549: expected command, found L_PAREN -ERROR@3550: expected command, found IDENT -ERROR@3551: expected command, found R_PAREN -ERROR@3553: expected command, found IS_KW -ERROR@3556: expected command, found NOT_KW -ERROR@3560: expected command, found NULL_KW -ERROR@4077: expected EQ -ERROR@4078: expected an expression, found COLON -ERROR@4079: expected R_BRACK -ERROR@4079: expected SEMICOLON -ERROR@4079: expected command, found INT_NUMBER -ERROR@4080: expected command, found R_BRACK -ERROR@4082: expected command, found EQ -ERROR@4084: expected command, found STRING -ERROR@4098: expected command, found COMMA -ERROR@4100: expected command, found IDENT -ERROR@4101: expected command, found L_BRACK -ERROR@4102: expected command, found COLON -ERROR@4103: expected command, found INT_NUMBER -ERROR@4104: expected command, found R_BRACK -ERROR@4105: expected command, found L_BRACK -ERROR@4106: expected command, found COLON -ERROR@4107: expected command, found INT_NUMBER -ERROR@4108: expected command, found R_BRACK -ERROR@4110: expected command, found EQ -ERROR@4112: expected command, found STRING -ERROR@4135: expected command, found WHERE_KW -ERROR@4141: expected command, found IDENT -ERROR@4152: expected command, found L_PAREN -ERROR@4153: expected command, found IDENT -ERROR@4154: expected command, found COMMA -ERROR@4155: expected command, found INT_NUMBER -ERROR@4156: expected command, found R_PAREN -ERROR@4158: expected command, found EQ -ERROR@4160: expected command, found INT_NUMBER -ERROR@4210: expected EQ -ERROR@4212: expected COMMA -ERROR@4212: expected R_BRACK -ERROR@4212: expected SEMICOLON -ERROR@4212: expected command, found COLON -ERROR@4213: expected command, found R_BRACK -ERROR@4215: expected command, found EQ -ERROR@4217: expected command, found STRING -ERROR@4231: expected command, found COMMA -ERROR@4233: expected command, found IDENT -ERROR@4234: expected command, found L_BRACK -ERROR@4235: expected command, found INT_NUMBER -ERROR@4236: expected command, found COLON -ERROR@4237: expected command, found R_BRACK -ERROR@4238: expected command, found L_BRACK -ERROR@4239: expected command, found INT_NUMBER -ERROR@4240: expected command, found COLON -ERROR@4241: expected command, found R_BRACK -ERROR@4243: expected command, found EQ -ERROR@4245: expected command, found STRING -ERROR@4314: expected EQ -ERROR@4315: expected an expression, found COLON -ERROR@4391: expected EQ -ERROR@4392: expected an expression, found COLON -ERROR@4497: expected EQ -ERROR@4498: expected an expression, found COLON -ERROR@4996: expected EQ -ERROR@5142: expected EQ -ERROR@5272: expected EQ -ERROR@5285: expected EQ -ERROR@5402: expected EQ -ERROR@5670: expected EQ -ERROR@5681: expected EQ -ERROR@5746: expected EQ -ERROR@5756: expected EQ -ERROR@5815: expected EQ -ERROR@5825: expected EQ -ERROR@5885: expected EQ -ERROR@5895: expected EQ -ERROR@5954: expected EQ -ERROR@5966: expected EQ -ERROR@6033: expected EQ -ERROR@6035: expected COMMA -ERROR@6035: expected R_BRACK -ERROR@6035: expected SEMICOLON -ERROR@6035: expected command, found COLON -ERROR@6036: expected command, found INT_NUMBER -ERROR@6037: expected command, found R_BRACK -ERROR@6039: expected command, found EQ -ERROR@6041: expected command, found ARRAY_KW -ERROR@6046: expected command, found L_BRACK -ERROR@6047: expected command, found INT_NUMBER -ERROR@6049: expected command, found COMMA -ERROR@6050: expected command, found INT_NUMBER -ERROR@6052: expected command, found COMMA -ERROR@6053: expected command, found INT_NUMBER -ERROR@6055: expected command, found R_BRACK -ERROR@6056: expected command, found COMMA -ERROR@6058: expected command, found IDENT -ERROR@6059: expected command, found L_BRACK -ERROR@6060: expected command, found INT_NUMBER -ERROR@6061: expected command, found COLON -ERROR@6062: expected command, found INT_NUMBER -ERROR@6063: expected command, found R_BRACK -ERROR@6065: expected command, found EQ -ERROR@6067: expected command, found ARRAY_KW -ERROR@6072: expected command, found L_BRACK -ERROR@6073: expected command, found STRING -ERROR@6078: expected command, found COMMA -ERROR@6079: expected command, found STRING -ERROR@6087: expected command, found COMMA -ERROR@6088: expected command, found STRING -ERROR@6096: expected command, found R_BRACK -ERROR@6144: expected EQ -ERROR@6146: expected COMMA -ERROR@6146: expected R_BRACK -ERROR@6146: expected SEMICOLON -ERROR@6146: expected command, found COLON -ERROR@6147: expected command, found INT_NUMBER -ERROR@6149: expected command, found R_BRACK -ERROR@6151: expected command, found EQ -ERROR@6153: expected command, found ARRAY_KW -ERROR@6158: expected command, found L_BRACK -ERROR@6159: expected command, found INT_NUMBER -ERROR@6161: expected command, found COMMA -ERROR@6162: expected command, found NULL_KW -ERROR@6166: expected command, found COMMA -ERROR@6167: expected command, found INT_NUMBER -ERROR@6169: expected command, found R_BRACK -ERROR@6170: expected command, found COMMA -ERROR@6172: expected command, found IDENT -ERROR@6173: expected command, found L_BRACK -ERROR@6174: expected command, found INT_NUMBER -ERROR@6175: expected command, found COLON -ERROR@6176: expected command, found INT_NUMBER -ERROR@6178: expected command, found R_BRACK -ERROR@6180: expected command, found EQ -ERROR@6182: expected command, found ARRAY_KW -ERROR@6187: expected command, found L_BRACK -ERROR@6188: expected command, found STRING -ERROR@6193: expected command, found COMMA -ERROR@6194: expected command, found NULL_KW -ERROR@6198: expected command, found COMMA -ERROR@6199: expected command, found STRING -ERROR@6204: expected command, found R_BRACK -ERROR@6252: expected EQ -ERROR@6255: expected COMMA -ERROR@6255: expected R_BRACK -ERROR@6255: expected SEMICOLON -ERROR@6255: expected command, found COLON -ERROR@6256: expected command, found INT_NUMBER -ERROR@6258: expected command, found R_BRACK -ERROR@6260: expected command, found EQ -ERROR@6262: expected command, found ARRAY_KW -ERROR@6267: expected command, found L_BRACK -ERROR@6268: expected command, found NULL_KW -ERROR@6272: expected command, found COMMA -ERROR@6273: expected command, found INT_NUMBER -ERROR@6275: expected command, found R_BRACK -ERROR@6276: expected command, found COMMA -ERROR@6278: expected command, found IDENT -ERROR@6279: expected command, found L_BRACK -ERROR@6280: expected command, found INT_NUMBER -ERROR@6282: expected command, found COLON -ERROR@6283: expected command, found INT_NUMBER -ERROR@6285: expected command, found R_BRACK -ERROR@6287: expected command, found EQ -ERROR@6289: expected command, found ARRAY_KW -ERROR@6294: expected command, found L_BRACK -ERROR@6295: expected command, found NULL_KW -ERROR@6299: expected command, found COMMA -ERROR@6300: expected command, found STRING -ERROR@6305: expected command, found R_BRACK -ERROR@6353: expected EQ -ERROR@6356: expected COMMA -ERROR@6356: expected R_BRACK -ERROR@6356: expected SEMICOLON -ERROR@6356: expected command, found COLON -ERROR@6357: expected command, found INT_NUMBER -ERROR@6359: expected command, found R_BRACK -ERROR@6361: expected command, found EQ -ERROR@6363: expected command, found ARRAY_KW -ERROR@6368: expected command, found L_BRACK -ERROR@6369: expected command, found NULL_KW -ERROR@6373: expected command, found COMMA -ERROR@6374: expected command, found INT_NUMBER -ERROR@6376: expected command, found R_BRACK -ERROR@6377: expected command, found COMMA -ERROR@6379: expected command, found IDENT -ERROR@6380: expected command, found L_BRACK -ERROR@6381: expected command, found INT_NUMBER -ERROR@6383: expected command, found COLON -ERROR@6384: expected command, found INT_NUMBER -ERROR@6386: expected command, found R_BRACK -ERROR@6388: expected command, found EQ -ERROR@6390: expected command, found ARRAY_KW -ERROR@6395: expected command, found L_BRACK -ERROR@6396: expected command, found NULL_KW -ERROR@6400: expected command, found COMMA -ERROR@6401: expected command, found STRING -ERROR@6406: expected command, found R_BRACK -ERROR@6454: expected EQ -ERROR@6457: expected COMMA -ERROR@6457: expected R_BRACK -ERROR@6457: expected SEMICOLON -ERROR@6457: expected command, found COLON -ERROR@6458: expected command, found MINUS -ERROR@6459: expected command, found INT_NUMBER -ERROR@6460: expected command, found R_BRACK -ERROR@6462: expected command, found EQ -ERROR@6464: expected command, found ARRAY_KW -ERROR@6469: expected command, found L_BRACK -ERROR@6470: expected command, found MINUS -ERROR@6471: expected command, found INT_NUMBER -ERROR@6473: expected command, found COMMA -ERROR@6474: expected command, found MINUS -ERROR@6475: expected command, found INT_NUMBER -ERROR@6477: expected command, found COMMA -ERROR@6478: expected command, found MINUS -ERROR@6479: expected command, found INT_NUMBER -ERROR@6481: expected command, found R_BRACK -ERROR@6482: expected command, found COMMA -ERROR@6484: expected command, found IDENT -ERROR@6485: expected command, found L_BRACK -ERROR@6486: expected command, found MINUS -ERROR@6487: expected command, found INT_NUMBER -ERROR@6488: expected command, found COLON -ERROR@6489: expected command, found MINUS -ERROR@6490: expected command, found INT_NUMBER -ERROR@6491: expected command, found R_BRACK -ERROR@6493: expected command, found EQ -ERROR@6495: expected command, found ARRAY_KW -ERROR@6500: expected command, found L_BRACK -ERROR@6501: expected command, found STRING -ERROR@6506: expected command, found COMMA -ERROR@6507: expected command, found STRING -ERROR@6512: expected command, found COMMA -ERROR@6513: expected command, found STRING -ERROR@6518: expected command, found R_BRACK -ERROR@6566: expected EQ -ERROR@6569: expected COMMA -ERROR@6569: expected R_BRACK -ERROR@6569: expected SEMICOLON -ERROR@6569: expected command, found COLON -ERROR@6570: expected command, found MINUS -ERROR@6571: expected command, found INT_NUMBER -ERROR@6572: expected command, found R_BRACK -ERROR@6574: expected command, found EQ -ERROR@6576: expected command, found ARRAY_KW -ERROR@6581: expected command, found L_BRACK -ERROR@6582: expected command, found MINUS -ERROR@6583: expected command, found INT_NUMBER -ERROR@6585: expected command, found COMMA -ERROR@6586: expected command, found NULL_KW -ERROR@6590: expected command, found R_BRACK -ERROR@6591: expected command, found COMMA -ERROR@6593: expected command, found IDENT -ERROR@6594: expected command, found L_BRACK -ERROR@6595: expected command, found MINUS -ERROR@6596: expected command, found INT_NUMBER -ERROR@6597: expected command, found COLON -ERROR@6598: expected command, found MINUS -ERROR@6599: expected command, found INT_NUMBER -ERROR@6600: expected command, found R_BRACK -ERROR@6602: expected command, found EQ -ERROR@6604: expected command, found ARRAY_KW -ERROR@6609: expected command, found L_BRACK -ERROR@6610: expected command, found STRING -ERROR@6615: expected command, found COMMA -ERROR@6616: expected command, found NULL_KW -ERROR@6620: expected command, found R_BRACK -ERROR@6668: expected EQ -ERROR@6672: expected COMMA -ERROR@6672: expected R_BRACK -ERROR@6672: expected SEMICOLON -ERROR@6672: expected command, found COLON -ERROR@6673: expected command, found MINUS -ERROR@6674: expected command, found INT_NUMBER -ERROR@6676: expected command, found R_BRACK -ERROR@6678: expected command, found EQ -ERROR@6680: expected command, found ARRAY_KW -ERROR@6685: expected command, found L_BRACK -ERROR@6686: expected command, found MINUS -ERROR@6687: expected command, found INT_NUMBER -ERROR@6689: expected command, found COMMA -ERROR@6690: expected command, found NULL_KW -ERROR@6694: expected command, found COMMA -ERROR@6695: expected command, found MINUS -ERROR@6696: expected command, found INT_NUMBER -ERROR@6698: expected command, found R_BRACK -ERROR@6699: expected command, found COMMA -ERROR@6701: expected command, found IDENT -ERROR@6702: expected command, found L_BRACK -ERROR@6703: expected command, found MINUS -ERROR@6704: expected command, found INT_NUMBER -ERROR@6706: expected command, found COLON -ERROR@6707: expected command, found MINUS -ERROR@6708: expected command, found INT_NUMBER -ERROR@6710: expected command, found R_BRACK -ERROR@6712: expected command, found EQ -ERROR@6714: expected command, found ARRAY_KW -ERROR@6719: expected command, found L_BRACK -ERROR@6720: expected command, found STRING -ERROR@6725: expected command, found COMMA -ERROR@6726: expected command, found NULL_KW -ERROR@6730: expected command, found COMMA -ERROR@6731: expected command, found STRING -ERROR@6736: expected command, found R_BRACK -ERROR@6910: expected EQ -ERROR@6912: expected COMMA -ERROR@6912: expected R_BRACK -ERROR@6912: expected SEMICOLON -ERROR@6912: expected command, found COLON -ERROR@6913: expected command, found INT_NUMBER -ERROR@6914: expected command, found R_BRACK -ERROR@6916: expected command, found EQ -ERROR@6918: expected command, found ARRAY_KW -ERROR@6923: expected command, found L_BRACK -ERROR@6924: expected command, found INT_NUMBER -ERROR@6925: expected command, found COMMA -ERROR@6926: expected command, found INT_NUMBER -ERROR@6927: expected command, found COMMA -ERROR@6928: expected command, found INT_NUMBER -ERROR@6929: expected command, found COMMA -ERROR@6930: expected command, found NULL_KW -ERROR@6934: expected command, found COMMA -ERROR@6935: expected command, found INT_NUMBER -ERROR@6936: expected command, found COMMA -ERROR@6937: expected command, found INT_NUMBER -ERROR@6938: expected command, found R_BRACK -ERROR@6939: expected command, found COMMA -ERROR@6941: expected command, found IDENT -ERROR@6942: expected command, found L_BRACK -ERROR@6943: expected command, found INT_NUMBER -ERROR@6944: expected command, found COLON -ERROR@6945: expected command, found INT_NUMBER -ERROR@6946: expected command, found R_BRACK -ERROR@6948: expected command, found EQ -ERROR@6950: expected command, found ARRAY_KW -ERROR@6955: expected command, found L_BRACK -ERROR@6956: expected command, found STRING -ERROR@6959: expected command, found COMMA -ERROR@6960: expected command, found STRING -ERROR@6964: expected command, found COMMA -ERROR@6965: expected command, found STRING -ERROR@6969: expected command, found COMMA -ERROR@6970: expected command, found NULL_KW -ERROR@6974: expected command, found COMMA -ERROR@6975: expected command, found STRING -ERROR@6979: expected command, found COMMA -ERROR@6980: expected command, found STRING -ERROR@6984: expected command, found R_BRACK ERROR@10382: expected SEMICOLON ERROR@10383: expected command, found LANGUAGE_KW ERROR@10392: expected command, found IDENT -ERROR@15187: expected EQ -ERROR@15211: expected EQ -ERROR@15345: expected EQ -ERROR@15373: expected EQ -ERROR@15401: expected EQ -ERROR@15882: expected EQ -ERROR@15939: expected EQ -ERROR@15950: expected COMMA -ERROR@15950: expected R_BRACK -ERROR@15950: expected SEMICOLON -ERROR@15950: expected command, found COLON -ERROR@15951: expected command, found INT_NUMBER -ERROR@15961: expected command, found R_BRACK -ERROR@15963: expected command, found EQ -ERROR@15965: expected command, found ARRAY_KW -ERROR@15970: expected command, found L_BRACK -ERROR@15971: expected command, found INT_NUMBER -ERROR@15972: expected command, found COMMA -ERROR@15973: expected command, found INT_NUMBER -ERROR@15974: expected command, found R_BRACK -ERROR@15976: expected command, found WHERE_KW -ERROR@15982: expected command, found IDENT -ERROR@15985: expected command, found EQ -ERROR@15987: expected command, found INT_NUMBER ERROR@16637: missing comma ERROR@16686: missing comma -ERROR@27671: expected EQ diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap b/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap index b3e17e09..366afad4 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap @@ -18,9 +18,6 @@ ERROR@3858: missing comma ERROR@4012: expected SEMICOLON ERROR@4013: expected command, found ILIKE_KW ERROR@4019: expected command, found STRING -ERROR@9313: expected R_PAREN -ERROR@9325: expected SEMICOLON -ERROR@9325: expected command, found R_PAREN ERROR@12097: expected SEMICOLON ERROR@12098: expected command, found ILIKE_KW ERROR@12104: expected command, found STRING @@ -57,4 +54,4 @@ ERROR@22668: expected command, found STRING ERROR@24211: expected SEMICOLON ERROR@24212: expected command, found ILIKE_KW ERROR@24218: expected command, found STRING -ERROR@42437: expected STORED_KW +ERROR@42437: expected STORED or VIRTUAL diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap b/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap index 51bcbee8..12844042 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap @@ -18,9 +18,6 @@ ERROR@3588: missing comma ERROR@3739: expected SEMICOLON ERROR@3740: expected command, found ILIKE_KW ERROR@3746: expected command, found STRING -ERROR@9210: expected R_PAREN -ERROR@9222: expected SEMICOLON -ERROR@9222: expected command, found R_PAREN ERROR@13571: expected SEMICOLON ERROR@13571: expected command, found COMMA ERROR@13573: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_collate.snap b/crates/squawk_parser/tests/snapshots/tests__regression_collate.snap deleted file mode 100644 index 17b8e092..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_collate.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/collate.sql ---- -ERROR@6741: expected R_PAREN -ERROR@6753: expected SEMICOLON -ERROR@6753: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_misc.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_misc.snap deleted file mode 100644 index 1b10946e..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_misc.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_misc.sql ---- -ERROR@4822: expected SEMICOLON -ERROR@4823: expected command, found NOTNULL_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_role.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_role.snap deleted file mode 100644 index f3d6f960..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_role.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_role.sql ---- -ERROR@6257: expected SEMICOLON -ERROR@6257: expected command, found COMMA -ERROR@6262: expected name -ERROR@6262: expected EQ diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_schema.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_schema.snap deleted file mode 100644 index 0b507b06..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_schema.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_schema.sql ---- -ERROR@666: expected SEMICOLON -ERROR@1283: expected SEMICOLON -ERROR@1915: expected SEMICOLON diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap index 9bde44d8..d51cb922 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap @@ -2,11 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/create_table_like.sql --- -ERROR@2170: expected STORED_KW -ERROR@2170: expected R_PAREN -ERROR@2170: expected SEMICOLON -ERROR@2171: expected command, found VIRTUAL_KW -ERROR@2178: expected command, found R_PAREN ERROR@5112: expected R_PAREN ERROR@5112: expected SEMICOLON ERROR@5113: expected command, found ENFORCED_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_type.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_type.snap deleted file mode 100644 index 6c986d99..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_type.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_type.sql ---- -ERROR@818: expected PRECISION_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap b/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap index 68cf1da6..da552094 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap @@ -30,169 +30,8 @@ ERROR@1253: expected L_PAREN ERROR@1267: expected L_PAREN ERROR@1277: expected R_PAREN ERROR@1277: expected R_PAREN -ERROR@4141: expected EQ -ERROR@4180: expected EQ -ERROR@5076: expected EQ -ERROR@5076: expected an expression, found DOT -ERROR@5077: expected expression -ERROR@5077: expected SEMICOLON -ERROR@5077: expected command, found IDENT -ERROR@5079: expected command, found EQ -ERROR@5081: expected command, found L_PAREN -ERROR@5082: expected command, found IDENT -ERROR@5084: expected command, found R_PAREN -ERROR@5085: expected command, found DOT -ERROR@5086: expected command, found IDENT -ERROR@5088: expected command, found PLUS -ERROR@5090: expected command, found INT_NUMBER -ERROR@5092: expected command, found WHERE_KW -ERROR@5098: expected command, found L_PAREN -ERROR@5099: expected command, found IDENT -ERROR@5101: expected command, found R_PAREN -ERROR@5102: expected command, found DOT -ERROR@5103: expected command, found IDENT -ERROR@5105: expected command, found R_ANGLE -ERROR@5107: expected command, found INT_NUMBER -ERROR@5623: expected EQ -ERROR@5623: expected an expression, found DOT -ERROR@5624: expected expression -ERROR@5624: expected SEMICOLON -ERROR@5624: expected command, found IDENT -ERROR@5626: expected command, found EQ -ERROR@5628: expected command, found L_PAREN -ERROR@5629: expected command, found IDENT -ERROR@5631: expected command, found R_PAREN -ERROR@5632: expected command, found DOT -ERROR@5633: expected command, found IDENT -ERROR@5635: expected command, found PLUS -ERROR@5637: expected command, found INT_NUMBER -ERROR@5639: expected command, found WHERE_KW -ERROR@5645: expected command, found L_PAREN -ERROR@5646: expected command, found IDENT -ERROR@5648: expected command, found R_PAREN -ERROR@5649: expected command, found DOT -ERROR@5650: expected command, found IDENT -ERROR@5652: expected command, found R_ANGLE -ERROR@5654: expected command, found INT_NUMBER -ERROR@5690: expected EQ -ERROR@5690: expected an expression, found DOT -ERROR@5691: expected expression -ERROR@5691: expected SEMICOLON -ERROR@5691: expected command, found IDENT -ERROR@5693: expected command, found EQ -ERROR@5695: expected command, found L_PAREN -ERROR@5696: expected command, found IDENT -ERROR@5698: expected command, found R_PAREN -ERROR@5699: expected command, found DOT -ERROR@5700: expected command, found IDENT -ERROR@5702: expected command, found MINUS -ERROR@5704: expected command, found INT_NUMBER -ERROR@5705: expected command, found COMMA -ERROR@5707: expected command, found IDENT -ERROR@5709: expected command, found DOT -ERROR@5710: expected command, found IDENT -ERROR@5712: expected command, found EQ -ERROR@5714: expected command, found L_PAREN -ERROR@5715: expected command, found IDENT -ERROR@5717: expected command, found R_PAREN -ERROR@5718: expected command, found DOT -ERROR@5719: expected command, found IDENT -ERROR@5721: expected command, found PLUS -ERROR@5723: expected command, found INT_NUMBER -ERROR@5725: expected command, found WHERE_KW -ERROR@5731: expected command, found L_PAREN -ERROR@5732: expected command, found IDENT -ERROR@5734: expected command, found R_PAREN -ERROR@5735: expected command, found DOT -ERROR@5736: expected command, found IDENT -ERROR@5738: expected command, found R_ANGLE -ERROR@5740: expected command, found INT_NUMBER -ERROR@5825: expected EQ -ERROR@5825: expected an expression, found DOT -ERROR@5826: expected expression -ERROR@5826: expected SEMICOLON -ERROR@5826: expected command, found IDENT -ERROR@5828: expected command, found EQ -ERROR@5830: expected command, found L_PAREN -ERROR@5831: expected command, found IDENT -ERROR@5833: expected command, found R_PAREN -ERROR@5834: expected command, found DOT -ERROR@5835: expected command, found IDENT -ERROR@5837: expected command, found MINUS -ERROR@5839: expected command, found INT_NUMBER -ERROR@5840: expected command, found COMMA -ERROR@5842: expected command, found IDENT -ERROR@5844: expected command, found DOT -ERROR@5845: expected command, found IDENT -ERROR@5847: expected command, found EQ -ERROR@5849: expected command, found L_PAREN -ERROR@5850: expected command, found IDENT -ERROR@5852: expected command, found R_PAREN -ERROR@5853: expected command, found DOT -ERROR@5854: expected command, found IDENT -ERROR@5856: expected command, found PLUS -ERROR@5858: expected command, found INT_NUMBER -ERROR@5860: expected command, found WHERE_KW -ERROR@5866: expected command, found L_PAREN -ERROR@5867: expected command, found IDENT -ERROR@5869: expected command, found R_PAREN -ERROR@5870: expected command, found DOT -ERROR@5871: expected command, found IDENT -ERROR@5873: expected command, found R_ANGLE -ERROR@5875: expected command, found INT_NUMBER -ERROR@5960: expected EQ -ERROR@5960: expected an expression, found DOT -ERROR@5961: expected expression -ERROR@5961: expected SEMICOLON -ERROR@5961: expected command, found IDENT -ERROR@5963: expected command, found EQ -ERROR@5965: expected command, found L_PAREN -ERROR@5966: expected command, found IDENT -ERROR@5968: expected command, found R_PAREN -ERROR@5969: expected command, found DOT -ERROR@5970: expected command, found IDENT -ERROR@5972: expected command, found MINUS -ERROR@5974: expected command, found INT_NUMBER -ERROR@5975: expected command, found COMMA -ERROR@5977: expected command, found IDENT -ERROR@5979: expected command, found DOT -ERROR@5980: expected command, found IDENT -ERROR@5982: expected command, found EQ -ERROR@5984: expected command, found L_PAREN -ERROR@5985: expected command, found IDENT -ERROR@5987: expected command, found R_PAREN -ERROR@5988: expected command, found DOT -ERROR@5989: expected command, found IDENT -ERROR@5991: expected command, found PLUS -ERROR@5993: expected command, found INT_NUMBER -ERROR@5995: expected command, found WHERE_KW -ERROR@6001: expected command, found L_PAREN -ERROR@6002: expected command, found IDENT -ERROR@6004: expected command, found R_PAREN -ERROR@6005: expected command, found DOT -ERROR@6006: expected command, found IDENT -ERROR@6008: expected command, found R_ANGLE -ERROR@6010: expected command, found INT_NUMBER -ERROR@7709: expected EQ -ERROR@7788: expected EQ -ERROR@8387: expected EQ -ERROR@8459: expected EQ -ERROR@8482: expected EQ -ERROR@8605: expected EQ -ERROR@8628: expected EQ -ERROR@8753: expected EQ -ERROR@8776: expected EQ -ERROR@9138: expected EQ -ERROR@9176: expected EQ -ERROR@10123: expected EQ -ERROR@10292: expected EQ -ERROR@10387: expected R_PAREN -ERROR@10387: expected EQ -ERROR@10387: expected SEMICOLON -ERROR@10387: expected command, found L_BRACK -ERROR@10388: expected command, found INT_NUMBER -ERROR@10389: expected command, found R_BRACK -ERROR@10390: expected command, found R_PAREN +ERROR@10391: expected EQ +ERROR@10391: expected SEMICOLON ERROR@10391: expected command, found L_BRACK ERROR@10392: expected command, found INT_NUMBER ERROR@10393: expected command, found R_BRACK @@ -201,12 +40,6 @@ ERROR@10397: expected command, found ARRAY_KW ERROR@10402: expected command, found L_BRACK ERROR@10403: expected command, found INT_NUMBER ERROR@10405: expected command, found R_BRACK -ERROR@10717: expected EQ -ERROR@10772: expected EQ -ERROR@10819: expected EQ -ERROR@10992: expected EQ -ERROR@23152: expected EQ -ERROR@23177: expected EQ ERROR@25791: expected SEMICOLON ERROR@25792: expected command, found ENFORCED_KW ERROR@25898: expected NULL_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_event_trigger.snap b/crates/squawk_parser/tests/snapshots/tests__regression_event_trigger.snap deleted file mode 100644 index f822952c..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_event_trigger.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/event_trigger.sql ---- -ERROR@2901: expected R_PAREN -ERROR@2901: expected SEMICOLON -ERROR@2901: expected command, found STRING -ERROR@2923: expected command, found R_PAREN -ERROR@10577: expected SEMICOLON -ERROR@10614: expected SEMICOLON -ERROR@10692: expected SEMICOLON diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_fast_default.snap b/crates/squawk_parser/tests/snapshots/tests__regression_fast_default.snap deleted file mode 100644 index 169b8129..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_fast_default.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/fast_default.sql ---- -ERROR@1942: expected STORED_KW -ERROR@1942: expected SEMICOLON -ERROR@1943: expected command, found VIRTUAL_KW -ERROR@2272: expected STORED_KW -ERROR@2272: expected SEMICOLON -ERROR@2273: expected command, found VIRTUAL_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap b/crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap index eb77b0a3..58aab9b7 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_generated_stored.snap @@ -12,15 +12,6 @@ ERROR@2758: expected command, found INT_NUMBER ERROR@2759: expected command, found R_PAREN ERROR@2761: expected command, found STORED_KW ERROR@2767: expected command, found R_PAREN -ERROR@6424: expected STORED_KW -ERROR@6424: expected R_PAREN -ERROR@6424: expected SEMICOLON -ERROR@6425: expected command, found VIRTUAL_KW -ERROR@6432: expected command, found R_PAREN -ERROR@6434: expected command, found INHERITS_KW -ERROR@6443: expected command, found L_PAREN -ERROR@6444: expected command, found IDENT -ERROR@6450: expected command, found R_PAREN ERROR@10576: expected TO_KW ERROR@10576: expected role, got COMMA ERROR@10584: expected SEMICOLON @@ -28,21 +19,3 @@ ERROR@10585: expected command, found ON_KW ERROR@10588: expected command, found IDENT ERROR@10596: expected command, found TO_KW ERROR@10599: expected command, found IDENT -ERROR@17943: expected STORED_KW -ERROR@17943: expected R_PAREN -ERROR@17943: expected DEFAULT_KW -ERROR@17943: expected SEMICOLON -ERROR@17944: expected command, found VIRTUAL_KW -ERROR@17962: expected command, found R_PAREN -ERROR@17964: expected command, found FOR_KW -ERROR@17975: expected L_PAREN -ERROR@17994: expected SEMICOLON -ERROR@17995: expected command, found TO_KW -ERROR@17998: expected command, found L_PAREN -ERROR@17999: expected command, found STRING -ERROR@18011: expected command, found R_PAREN -ERROR@18770: expected STORED_KW -ERROR@18770: expected R_PAREN -ERROR@18770: expected SEMICOLON -ERROR@18771: expected command, found VIRTUAL_KW -ERROR@18778: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap b/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap index 1e9168ce..03f60c98 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap @@ -2,107 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/generated_virtual.sql --- -ERROR@266: expected STORED_KW -ERROR@266: expected R_PAREN -ERROR@266: expected SEMICOLON -ERROR@267: expected command, found VIRTUAL_KW -ERROR@274: expected command, found R_PAREN -ERROR@350: expected STORED_KW -ERROR@350: expected R_PAREN -ERROR@350: expected SEMICOLON -ERROR@351: expected command, found VIRTUAL_KW -ERROR@358: expected command, found R_PAREN -ERROR@815: expected STORED_KW -ERROR@815: expected R_PAREN -ERROR@815: expected SEMICOLON -ERROR@816: expected command, found VIRTUAL_KW -ERROR@824: expected command, found GENERATED_KW -ERROR@834: expected command, found ALWAYS_KW -ERROR@841: expected command, found AS_KW -ERROR@844: expected command, found L_PAREN -ERROR@845: expected command, found IDENT -ERROR@847: expected command, found STAR -ERROR@849: expected command, found INT_NUMBER -ERROR@850: expected command, found R_PAREN -ERROR@852: expected command, found VIRTUAL_KW -ERROR@859: expected command, found R_PAREN -ERROR@1010: expected STORED_KW -ERROR@1010: expected R_PAREN -ERROR@1010: expected SEMICOLON -ERROR@1011: expected command, found VIRTUAL_KW -ERROR@1018: expected command, found R_PAREN -ERROR@1100: expected STORED_KW -ERROR@1100: expected R_PAREN -ERROR@1100: expected SEMICOLON -ERROR@1101: expected command, found VIRTUAL_KW -ERROR@1108: expected command, found COMMA -ERROR@1110: expected command, found IDENT -ERROR@1112: expected command, found INT_KW -ERROR@1116: expected command, found GENERATED_KW -ERROR@1126: expected command, found ALWAYS_KW -ERROR@1133: expected command, found AS_KW -ERROR@1136: expected command, found L_PAREN -ERROR@1137: expected command, found IDENT -ERROR@1139: expected command, found STAR -ERROR@1141: expected command, found INT_NUMBER -ERROR@1142: expected command, found R_PAREN -ERROR@1144: expected command, found VIRTUAL_KW -ERROR@1151: expected command, found R_PAREN -ERROR@1328: expected STORED_KW -ERROR@1328: expected R_PAREN -ERROR@1328: expected SEMICOLON -ERROR@1329: expected command, found VIRTUAL_KW -ERROR@1336: expected command, found R_PAREN -ERROR@1439: expected STORED_KW -ERROR@1439: expected R_PAREN -ERROR@1439: expected SEMICOLON -ERROR@1440: expected command, found VIRTUAL_KW -ERROR@1447: expected command, found R_PAREN -ERROR@1588: expected STORED_KW -ERROR@1588: expected R_PAREN -ERROR@1588: expected SEMICOLON -ERROR@1589: expected command, found VIRTUAL_KW -ERROR@1596: expected command, found R_PAREN -ERROR@1725: expected STORED_KW -ERROR@1725: expected R_PAREN -ERROR@1725: expected SEMICOLON -ERROR@1726: expected command, found VIRTUAL_KW -ERROR@1733: expected command, found R_PAREN -ERROR@1891: expected STORED_KW -ERROR@1891: expected R_PAREN -ERROR@1891: expected SEMICOLON -ERROR@1892: expected command, found VIRTUAL_KW -ERROR@1899: expected command, found R_PAREN -ERROR@2010: expected STORED_KW -ERROR@2010: expected R_PAREN -ERROR@2010: expected SEMICOLON -ERROR@2011: expected command, found VIRTUAL_KW -ERROR@2018: expected command, found R_PAREN -ERROR@2211: expected STORED_KW -ERROR@2211: expected R_PAREN -ERROR@2211: expected SEMICOLON -ERROR@2212: expected command, found VIRTUAL_KW -ERROR@2219: expected command, found R_PAREN -ERROR@2336: expected STORED_KW -ERROR@2336: expected R_PAREN -ERROR@2336: expected SEMICOLON -ERROR@2337: expected command, found VIRTUAL_KW -ERROR@2344: expected command, found R_PAREN -ERROR@2451: expected STORED_KW -ERROR@2451: expected R_PAREN -ERROR@2451: expected SEMICOLON -ERROR@2452: expected command, found VIRTUAL_KW -ERROR@2459: expected command, found R_PAREN -ERROR@2546: expected STORED_KW -ERROR@2546: expected R_PAREN -ERROR@2546: expected SEMICOLON -ERROR@2547: expected command, found VIRTUAL_KW -ERROR@2554: expected command, found R_PAREN -ERROR@2652: expected STORED_KW -ERROR@2652: expected R_PAREN -ERROR@2652: expected SEMICOLON -ERROR@2653: expected command, found VIRTUAL_KW -ERROR@2660: expected command, found R_PAREN ERROR@2774: expected IDENTITY_KW ERROR@2776: expected R_PAREN ERROR@2776: expected R_PAREN @@ -113,144 +12,6 @@ ERROR@2780: expected command, found INT_NUMBER ERROR@2781: expected command, found R_PAREN ERROR@2783: expected command, found VIRTUAL_KW ERROR@2790: expected command, found R_PAREN -ERROR@4235: expected STORED_KW -ERROR@4235: expected R_PAREN -ERROR@4235: expected SEMICOLON -ERROR@4236: expected command, found VIRTUAL_KW -ERROR@4243: expected command, found COMMA -ERROR@4247: expected command, found IDENT -ERROR@4250: expected command, found INT_KW -ERROR@4254: expected command, found GENERATED_KW -ERROR@4264: expected command, found ALWAYS_KW -ERROR@4271: expected command, found AS_KW -ERROR@4274: expected command, found L_PAREN -ERROR@4275: expected command, found IDENT -ERROR@4278: expected command, found STAR -ERROR@4280: expected command, found INT_NUMBER -ERROR@4281: expected command, found R_PAREN -ERROR@4283: expected command, found VIRTUAL_KW -ERROR@4291: expected command, found R_PAREN -ERROR@4681: expected STORED_KW -ERROR@4681: expected R_PAREN -ERROR@4681: expected SEMICOLON -ERROR@4682: expected command, found VIRTUAL_KW -ERROR@4690: expected command, found R_PAREN -ERROR@5927: expected STORED_KW -ERROR@5927: expected R_PAREN -ERROR@5927: expected SEMICOLON -ERROR@5928: expected command, found VIRTUAL_KW -ERROR@5935: expected command, found R_PAREN -ERROR@5937: expected command, found INHERITS_KW -ERROR@5946: expected command, found L_PAREN -ERROR@5947: expected command, found IDENT -ERROR@5959: expected command, found R_PAREN -ERROR@6045: expected STORED_KW -ERROR@6045: expected R_PAREN -ERROR@6045: expected SEMICOLON -ERROR@6046: expected command, found VIRTUAL_KW -ERROR@6053: expected command, found R_PAREN -ERROR@6551: expected STORED_KW -ERROR@6551: expected R_PAREN -ERROR@6551: expected SEMICOLON -ERROR@6552: expected command, found VIRTUAL_KW -ERROR@6559: expected command, found R_PAREN -ERROR@6561: expected command, found INHERITS_KW -ERROR@6570: expected command, found L_PAREN -ERROR@6571: expected command, found IDENT -ERROR@6577: expected command, found R_PAREN -ERROR@6862: expected STORED_KW -ERROR@6862: expected R_PAREN -ERROR@6862: expected SEMICOLON -ERROR@6863: expected command, found VIRTUAL_KW -ERROR@6870: expected command, found R_PAREN -ERROR@6975: expected STORED_KW -ERROR@6975: expected R_PAREN -ERROR@6975: expected SEMICOLON -ERROR@6976: expected command, found VIRTUAL_KW -ERROR@6983: expected command, found COMMA -ERROR@6985: expected command, found IDENT -ERROR@6987: expected command, found INT_KW -ERROR@6991: expected command, found NOT_KW -ERROR@6995: expected command, found NULL_KW -ERROR@6999: expected command, found R_PAREN -ERROR@7397: expected STORED_KW -ERROR@7397: expected R_PAREN -ERROR@7397: expected SEMICOLON -ERROR@7398: expected command, found VIRTUAL_KW -ERROR@7405: expected command, found R_PAREN -ERROR@7526: expected STORED_KW -ERROR@7526: expected R_PAREN -ERROR@7526: expected SEMICOLON -ERROR@7527: expected command, found VIRTUAL_KW -ERROR@7534: expected command, found R_PAREN -ERROR@7536: expected command, found INHERITS_KW -ERROR@7545: expected command, found L_PAREN -ERROR@7546: expected command, found IDENT -ERROR@7552: expected command, found COMMA -ERROR@7554: expected command, found IDENT -ERROR@7560: expected command, found R_PAREN -ERROR@7721: expected STORED_KW -ERROR@7721: expected R_PAREN -ERROR@7721: expected SEMICOLON -ERROR@7722: expected command, found VIRTUAL_KW -ERROR@7729: expected command, found R_PAREN -ERROR@7731: expected command, found INHERITS_KW -ERROR@7739: expected command, found L_PAREN -ERROR@7740: expected command, found IDENT -ERROR@7746: expected command, found R_PAREN -ERROR@7944: expected STORED_KW -ERROR@7944: expected R_PAREN -ERROR@7944: expected SEMICOLON -ERROR@7945: expected command, found VIRTUAL_KW -ERROR@7952: expected command, found R_PAREN -ERROR@8185: expected STORED_KW -ERROR@8185: expected R_PAREN -ERROR@8185: expected SEMICOLON -ERROR@8186: expected command, found VIRTUAL_KW -ERROR@8193: expected command, found R_PAREN -ERROR@8759: expected STORED_KW -ERROR@8759: expected R_PAREN -ERROR@8759: expected SEMICOLON -ERROR@8760: expected command, found VIRTUAL_KW -ERROR@8767: expected command, found R_PAREN -ERROR@8941: expected STORED_KW -ERROR@8941: expected R_PAREN -ERROR@8941: expected SEMICOLON -ERROR@8942: expected command, found VIRTUAL_KW -ERROR@8949: expected command, found R_PAREN -ERROR@9272: expected STORED_KW -ERROR@9272: expected R_PAREN -ERROR@9272: expected SEMICOLON -ERROR@9273: expected command, found VIRTUAL_KW -ERROR@9281: expected command, found R_PAREN -ERROR@9533: expected STORED_KW -ERROR@9533: expected R_PAREN -ERROR@9533: expected SEMICOLON -ERROR@9534: expected command, found VIRTUAL_KW -ERROR@9542: expected command, found R_PAREN -ERROR@9670: expected STORED_KW -ERROR@9670: expected SEMICOLON -ERROR@9671: expected command, found VIRTUAL_KW -ERROR@9816: expected STORED_KW -ERROR@9816: expected R_PAREN -ERROR@9816: expected SEMICOLON -ERROR@9817: expected command, found VIRTUAL_KW -ERROR@9824: expected command, found R_PAREN -ERROR@10008: expected STORED_KW -ERROR@10008: expected R_PAREN -ERROR@10008: expected SEMICOLON -ERROR@10009: expected command, found VIRTUAL_KW -ERROR@10016: expected command, found R_PAREN -ERROR@10217: expected STORED_KW -ERROR@10217: expected R_PAREN -ERROR@10217: expected SEMICOLON -ERROR@10218: expected command, found VIRTUAL_KW -ERROR@10225: expected command, found R_PAREN -ERROR@10537: expected STORED_KW -ERROR@10537: expected R_PAREN -ERROR@10537: expected SEMICOLON -ERROR@10538: expected command, found VIRTUAL_KW -ERROR@10545: expected command, found R_PAREN ERROR@10612: expected TO_KW ERROR@10612: expected role, got COMMA ERROR@10620: expected SEMICOLON @@ -258,55 +19,15 @@ ERROR@10621: expected command, found ON_KW ERROR@10624: expected command, found IDENT ERROR@10632: expected command, found TO_KW ERROR@10635: expected command, found IDENT -ERROR@11219: expected STORED_KW -ERROR@11219: expected R_PAREN -ERROR@11219: expected SEMICOLON -ERROR@11220: expected command, found VIRTUAL_KW -ERROR@11228: expected command, found CHECK_KW -ERROR@11234: expected command, found L_PAREN -ERROR@11235: expected command, found IDENT -ERROR@11237: expected command, found L_ANGLE -ERROR@11239: expected command, found INT_NUMBER -ERROR@11241: expected command, found R_PAREN -ERROR@11242: expected command, found R_PAREN -ERROR@11636: expected STORED_KW -ERROR@11636: expected R_PAREN -ERROR@11636: expected SEMICOLON -ERROR@11637: expected command, found VIRTUAL_KW -ERROR@11644: expected command, found R_PAREN -ERROR@12068: expected STORED_KW -ERROR@12068: expected R_PAREN -ERROR@12068: expected SEMICOLON -ERROR@12069: expected command, found VIRTUAL_KW -ERROR@12076: expected command, found R_PAREN -ERROR@12391: expected STORED_KW -ERROR@12391: expected R_PAREN -ERROR@12391: expected SEMICOLON -ERROR@12392: expected command, found VIRTUAL_KW -ERROR@12399: expected command, found R_PAREN -ERROR@12677: expected STORED_KW -ERROR@12677: expected R_PAREN -ERROR@12677: expected SEMICOLON -ERROR@12678: expected command, found VIRTUAL_KW -ERROR@12686: expected command, found NOT_KW -ERROR@12690: expected command, found NULL_KW -ERROR@12694: expected command, found R_PAREN -ERROR@12929: expected STORED_KW -ERROR@12929: expected R_PAREN -ERROR@12929: expected SEMICOLON -ERROR@12930: expected command, found VIRTUAL_KW -ERROR@12937: expected command, found COMMA -ERROR@12939: expected command, found CONSTRAINT_KW -ERROR@12950: expected command, found IDENT -ERROR@12953: expected command, found NOT_KW +ERROR@12952: expected FOREIGN_KW +ERROR@12952: expected KEY_KW +ERROR@12952: expected column list +ERROR@12952: expected REFERENCES_KW +ERROR@12956: expected R_PAREN +ERROR@12956: expected SEMICOLON ERROR@12957: expected command, found NULL_KW ERROR@12962: expected command, found IDENT ERROR@12963: expected command, found R_PAREN -ERROR@13304: expected STORED_KW -ERROR@13304: expected R_PAREN -ERROR@13304: expected SEMICOLON -ERROR@13305: expected command, found VIRTUAL_KW -ERROR@13312: expected command, found R_PAREN ERROR@13354: expected FOREIGN_KW ERROR@13354: expected KEY_KW ERROR@13354: expected column list @@ -314,291 +35,6 @@ ERROR@13354: expected REFERENCES_KW ERROR@13358: expected SEMICOLON ERROR@13359: expected command, found NULL_KW ERROR@13364: expected command, found IDENT -ERROR@13522: expected STORED_KW -ERROR@13522: expected R_PAREN -ERROR@13522: expected SEMICOLON -ERROR@13523: expected command, found VIRTUAL_KW -ERROR@13530: expected command, found R_PAREN -ERROR@14012: expected STORED_KW -ERROR@14012: expected R_PAREN -ERROR@14012: expected SEMICOLON -ERROR@14013: expected command, found VIRTUAL_KW -ERROR@14021: expected command, found NOT_KW -ERROR@14025: expected command, found NULL_KW -ERROR@14030: expected command, found R_PAREN -ERROR@14032: expected command, found PARTITION_KW -ERROR@14042: expected command, found BY_KW -ERROR@14045: expected command, found RANGE_KW -ERROR@14051: expected command, found L_PAREN -ERROR@14052: expected command, found IDENT -ERROR@14054: expected command, found R_PAREN -ERROR@14804: expected STORED_KW -ERROR@14804: expected SEMICOLON -ERROR@14805: expected command, found VIRTUAL_KW -ERROR@14929: expected STORED_KW -ERROR@14929: expected SEMICOLON -ERROR@14930: expected command, found VIRTUAL_KW -ERROR@15053: expected STORED_KW -ERROR@15053: expected SEMICOLON -ERROR@15054: expected command, found VIRTUAL_KW -ERROR@15167: expected STORED_KW -ERROR@15167: expected R_PAREN -ERROR@15167: expected SEMICOLON -ERROR@15168: expected command, found VIRTUAL_KW -ERROR@15176: expected command, found UNIQUE_KW -ERROR@15182: expected command, found R_PAREN -ERROR@15353: expected STORED_KW -ERROR@15353: expected R_PAREN -ERROR@15353: expected SEMICOLON -ERROR@15354: expected command, found VIRTUAL_KW -ERROR@15361: expected command, found COMMA -ERROR@15363: expected command, found PRIMARY_KW -ERROR@15371: expected command, found KEY_KW -ERROR@15375: expected command, found L_PAREN -ERROR@15376: expected command, found IDENT -ERROR@15377: expected command, found COMMA -ERROR@15379: expected command, found IDENT -ERROR@15380: expected command, found R_PAREN -ERROR@15381: expected command, found R_PAREN -ERROR@15529: expected STORED_KW -ERROR@15529: expected R_PAREN -ERROR@15529: expected SEMICOLON -ERROR@15530: expected command, found VIRTUAL_KW -ERROR@15537: expected command, found R_PAREN -ERROR@16797: expected STORED_KW -ERROR@16797: expected R_PAREN -ERROR@16797: expected SEMICOLON -ERROR@16798: expected command, found VIRTUAL_KW -ERROR@16806: expected command, found REFERENCES_KW -ERROR@16817: expected command, found IDENT -ERROR@16826: expected command, found L_PAREN -ERROR@16827: expected command, found IDENT -ERROR@16828: expected command, found R_PAREN -ERROR@16830: expected command, found ON_KW -ERROR@16847: expected SET_KW -ERROR@16847: expected name -ERROR@16847: expected EQ -ERROR@16847: expected an expression, found R_PAREN -ERROR@16847: expected expression -ERROR@16847: expected SEMICOLON -ERROR@16847: expected command, found R_PAREN -ERROR@16935: expected STORED_KW -ERROR@16935: expected R_PAREN -ERROR@16935: expected SEMICOLON -ERROR@16936: expected command, found VIRTUAL_KW -ERROR@16944: expected command, found REFERENCES_KW -ERROR@16955: expected command, found IDENT -ERROR@16964: expected command, found L_PAREN -ERROR@16965: expected command, found IDENT -ERROR@16966: expected command, found R_PAREN -ERROR@16968: expected command, found ON_KW -ERROR@16977: expected FROM_KW -ERROR@16981: expected SEMICOLON -ERROR@16982: expected command, found NULL_KW -ERROR@16986: expected command, found R_PAREN -ERROR@17075: expected STORED_KW -ERROR@17075: expected R_PAREN -ERROR@17075: expected SEMICOLON -ERROR@17076: expected command, found VIRTUAL_KW -ERROR@17084: expected command, found REFERENCES_KW -ERROR@17095: expected command, found IDENT -ERROR@17104: expected command, found L_PAREN -ERROR@17105: expected command, found IDENT -ERROR@17106: expected command, found R_PAREN -ERROR@17107: expected command, found R_PAREN -ERROR@17468: expected STORED_KW -ERROR@17468: expected R_PAREN -ERROR@17468: expected SEMICOLON -ERROR@17469: expected command, found VIRTUAL_KW -ERROR@17476: expected command, found COMMA -ERROR@17478: expected command, found PRIMARY_KW -ERROR@17486: expected command, found KEY_KW -ERROR@17490: expected command, found L_PAREN -ERROR@17491: expected command, found IDENT -ERROR@17492: expected command, found R_PAREN -ERROR@17493: expected command, found R_PAREN -ERROR@17858: expected STORED_KW -ERROR@17858: expected R_PAREN -ERROR@17858: expected SEMICOLON -ERROR@17859: expected command, found VIRTUAL_KW -ERROR@17866: expected command, found R_PAREN -ERROR@18138: expected STORED_KW -ERROR@18138: expected R_PAREN -ERROR@18138: expected SEMICOLON -ERROR@18139: expected command, found VIRTUAL_KW -ERROR@18146: expected command, found R_PAREN -ERROR@18381: expected STORED_KW -ERROR@18381: expected R_PAREN -ERROR@18381: expected SEMICOLON -ERROR@18382: expected command, found VIRTUAL_KW -ERROR@18389: expected command, found R_PAREN -ERROR@18674: expected STORED_KW -ERROR@18674: expected R_PAREN -ERROR@18674: expected SEMICOLON -ERROR@18675: expected command, found VIRTUAL_KW -ERROR@18682: expected command, found R_PAREN -ERROR@18931: expected STORED_KW -ERROR@18931: expected R_PAREN -ERROR@18931: expected DEFAULT_KW -ERROR@18931: expected SEMICOLON -ERROR@18932: expected command, found VIRTUAL_KW -ERROR@18940: expected command, found R_PAREN -ERROR@18942: expected command, found FOR_KW -ERROR@18953: expected L_PAREN -ERROR@18972: expected SEMICOLON -ERROR@18973: expected command, found TO_KW -ERROR@18976: expected command, found L_PAREN -ERROR@18977: expected command, found STRING -ERROR@18989: expected command, found R_PAREN -ERROR@19094: expected STORED_KW -ERROR@19094: expected R_PAREN -ERROR@19094: expected SEMICOLON -ERROR@19095: expected command, found VIRTUAL_KW -ERROR@19102: expected command, found R_PAREN -ERROR@19351: expected STORED_KW -ERROR@19351: expected R_PAREN -ERROR@19351: expected SEMICOLON -ERROR@19352: expected command, found VIRTUAL_KW -ERROR@19359: expected command, found R_PAREN -ERROR@19361: expected command, found PARTITION_KW -ERROR@19371: expected command, found BY_KW -ERROR@19374: expected command, found RANGE_KW -ERROR@19380: expected command, found L_PAREN -ERROR@19381: expected command, found IDENT -ERROR@19383: expected command, found R_PAREN -ERROR@19614: expected STORED_KW -ERROR@19614: expected R_PAREN -ERROR@19614: expected DEFAULT_KW -ERROR@19614: expected SEMICOLON -ERROR@19615: expected command, found VIRTUAL_KW -ERROR@19646: expected command, found R_PAREN -ERROR@19648: expected command, found FOR_KW -ERROR@19659: expected L_PAREN -ERROR@19678: expected SEMICOLON -ERROR@19679: expected command, found TO_KW -ERROR@19682: expected command, found L_PAREN -ERROR@19683: expected command, found STRING -ERROR@19695: expected command, found R_PAREN -ERROR@21156: expected STORED_KW -ERROR@21156: expected R_PAREN -ERROR@21156: expected SEMICOLON -ERROR@21157: expected command, found VIRTUAL_KW -ERROR@21164: expected command, found R_PAREN -ERROR@22583: expected STORED_KW -ERROR@22583: expected R_PAREN -ERROR@22583: expected SEMICOLON -ERROR@22584: expected command, found VIRTUAL_KW -ERROR@22591: expected command, found R_PAREN -ERROR@22593: expected command, found PARTITION_KW -ERROR@22603: expected command, found BY_KW -ERROR@22606: expected command, found RANGE_KW -ERROR@22612: expected command, found L_PAREN -ERROR@22613: expected command, found IDENT -ERROR@22615: expected command, found R_PAREN -ERROR@22714: expected STORED_KW -ERROR@22714: expected R_PAREN -ERROR@22714: expected SEMICOLON -ERROR@22715: expected command, found VIRTUAL_KW -ERROR@22722: expected command, found R_PAREN -ERROR@22724: expected command, found PARTITION_KW -ERROR@22734: expected command, found BY_KW -ERROR@22737: expected command, found RANGE_KW -ERROR@22745: expected R_PAREN -ERROR@22745: expected R_PAREN -ERROR@22745: expected SEMICOLON -ERROR@22745: expected command, found IDENT -ERROR@22748: expected command, found STAR -ERROR@22750: expected command, found INT_NUMBER -ERROR@22751: expected command, found R_PAREN -ERROR@22752: expected command, found R_PAREN -ERROR@22929: expected STORED_KW -ERROR@22929: expected SEMICOLON -ERROR@22930: expected command, found VIRTUAL_KW -ERROR@22937: expected command, found COMMA -ERROR@22939: expected command, found ALTER_KW -ERROR@22945: expected command, found COLUMN_KW -ERROR@22952: expected command, found IDENT -ERROR@22968: expected EQ -ERROR@22968: expected config value, got AS_KW -ERROR@22968: expected SEMICOLON -ERROR@22969: expected command, found AS_KW -ERROR@22972: expected command, found L_PAREN -ERROR@22973: expected command, found IDENT -ERROR@22975: expected command, found STAR -ERROR@22977: expected command, found INT_NUMBER -ERROR@22978: expected command, found R_PAREN -ERROR@23079: expected STORED_KW -ERROR@23079: expected SEMICOLON -ERROR@23080: expected command, found VIRTUAL_KW -ERROR@23163: expected STORED_KW -ERROR@23163: expected SEMICOLON -ERROR@23164: expected command, found VIRTUAL_KW -ERROR@23278: expected STORED_KW -ERROR@23278: expected SEMICOLON -ERROR@23279: expected command, found VIRTUAL_KW -ERROR@23444: expected STORED_KW -ERROR@23444: expected SEMICOLON -ERROR@23445: expected command, found VIRTUAL_KW -ERROR@23609: expected STORED_KW -ERROR@23609: expected R_PAREN -ERROR@23609: expected SEMICOLON -ERROR@23610: expected command, found VIRTUAL_KW -ERROR@23618: expected command, found R_PAREN -ERROR@24178: expected STORED_KW -ERROR@24178: expected SEMICOLON -ERROR@24179: expected command, found VIRTUAL_KW -ERROR@24187: expected command, found NOT_KW -ERROR@24191: expected command, found NULL_KW -ERROR@24463: expected STORED_KW -ERROR@24463: expected SEMICOLON -ERROR@24464: expected command, found VIRTUAL_KW -ERROR@24788: expected STORED_KW -ERROR@24788: expected R_PAREN -ERROR@24788: expected SEMICOLON -ERROR@24789: expected command, found VIRTUAL_KW -ERROR@24797: expected command, found R_PAREN -ERROR@25586: expected STORED_KW -ERROR@25586: expected R_PAREN -ERROR@25586: expected SEMICOLON -ERROR@25587: expected command, found VIRTUAL_KW -ERROR@25595: expected command, found R_PAREN -ERROR@25795: expected STORED_KW -ERROR@25795: expected R_PAREN -ERROR@25795: expected SEMICOLON -ERROR@25796: expected command, found VIRTUAL_KW -ERROR@25804: expected command, found R_PAREN -ERROR@26083: expected STORED_KW -ERROR@26083: expected R_PAREN -ERROR@26083: expected SEMICOLON -ERROR@26084: expected command, found VIRTUAL_KW -ERROR@26091: expected command, found COMMA -ERROR@26093: expected command, found IDENT -ERROR@26095: expected command, found TEXT_KW -ERROR@26099: expected command, found R_PAREN -ERROR@26350: expected STORED_KW -ERROR@26350: expected R_PAREN -ERROR@26350: expected SEMICOLON -ERROR@26351: expected command, found VIRTUAL_KW -ERROR@26358: expected command, found COMMA -ERROR@26360: expected command, found IDENT -ERROR@26362: expected command, found TEXT_KW -ERROR@26366: expected command, found R_PAREN -ERROR@26368: expected command, found PARTITION_KW -ERROR@26378: expected command, found BY_KW -ERROR@26381: expected command, found IDENT -ERROR@26386: expected command, found L_PAREN -ERROR@26387: expected command, found IDENT -ERROR@26388: expected command, found R_PAREN -ERROR@26626: expected STORED_KW -ERROR@26626: expected R_PAREN -ERROR@26626: expected SEMICOLON -ERROR@26627: expected command, found VIRTUAL_KW -ERROR@26635: expected command, found R_PAREN -ERROR@29461: expected STORED_KW -ERROR@29461: expected R_PAREN -ERROR@29461: expected SEMICOLON -ERROR@29462: expected command, found VIRTUAL_KW -ERROR@29470: expected command, found R_PAREN -ERROR@29901: expected STORED_KW -ERROR@29940: expected STORED_KW -ERROR@29988: expected STORED_KW +ERROR@29901: expected STORED or VIRTUAL +ERROR@29940: expected STORED or VIRTUAL +ERROR@29988: expected STORED or VIRTUAL diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_incremental_sort.snap b/crates/squawk_parser/tests/snapshots/tests__regression_incremental_sort.snap deleted file mode 100644 index 59baf64c..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_incremental_sort.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/incremental_sort.sql ---- -ERROR@9895: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap b/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap index 90805a9c..c393c7f1 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap @@ -84,9 +84,6 @@ ERROR@22909: expected command, found ENFORCED_KW ERROR@22917: expected command, found R_PAREN ERROR@25405: expected type name ERROR@25408: expected type name -ERROR@29267: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@29422: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@29565: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT ERROR@30331: expected R_PAREN ERROR@30426: missing comma ERROR@30455: expected SEMICOLON diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_insert_conflict.snap b/crates/squawk_parser/tests/snapshots/tests__regression_insert_conflict.snap index 73dea0a5..9ff45e95 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_insert_conflict.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_insert_conflict.snap @@ -113,13 +113,6 @@ ERROR@7056: expected string literal ERROR@7056: expected SEMICOLON ERROR@7073: expected SET_KW ERROR@7073: expected name -ERROR@7768: expected EQ -ERROR@7768: expected an expression, found DOT -ERROR@7769: expected expression -ERROR@7769: expected SEMICOLON -ERROR@7769: expected command, found IDENT -ERROR@7775: expected command, found EQ -ERROR@7777: expected command, found STRING ERROR@8491: expected R_PAREN ERROR@8491: expected SEMICOLON ERROR@8491: expected command, found L_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_int2.snap b/crates/squawk_parser/tests/snapshots/tests__regression_int2.snap deleted file mode 100644 index 566c307f..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_int2.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/int2.sql ---- -ERROR@2640: expected TYPE_KW -ERROR@2640: missing comma diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_int4.snap b/crates/squawk_parser/tests/snapshots/tests__regression_int4.snap deleted file mode 100644 index e9d93012..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_int4.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/int4.sql ---- -ERROR@3120: expected TYPE_KW -ERROR@3120: missing comma -ERROR@3243: expected TYPE_KW -ERROR@3243: missing comma diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_int8.snap b/crates/squawk_parser/tests/snapshots/tests__regression_int8.snap deleted file mode 100644 index ef43fc66..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_int8.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/int8.sql ---- -ERROR@5879: expected TYPE_KW -ERROR@5879: missing comma -ERROR@7894: expected TYPE_KW -ERROR@7894: missing comma -ERROR@8044: expected TYPE_KW -ERROR@8044: missing comma -ERROR@8194: expected TYPE_KW -ERROR@8194: missing comma diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_join.snap b/crates/squawk_parser/tests/snapshots/tests__regression_join.snap index 3edd2f74..b8cc19d1 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_join.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_join.snap @@ -2,7 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/join.sql --- -ERROR@77567: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT ERROR@93160: expected R_PAREN ERROR@93186: expected SEMICOLON ERROR@93186: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap b/crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap index 61686b33..7a3ce5d6 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_jsonb.snap @@ -10,38 +10,3 @@ ERROR@4591: expected FROM_KW ERROR@4591: expected L_PAREN ERROR@4593: expected call expression ERROR@4593: expected R_PAREN -ERROR@63353: expected EQ -ERROR@63488: expected EQ -ERROR@63609: expected EQ -ERROR@63726: expected EQ -ERROR@63851: expected EQ -ERROR@64241: expected EQ -ERROR@64296: expected EQ -ERROR@64473: expected EQ -ERROR@64640: expected EQ -ERROR@64839: expected EQ -ERROR@64928: expected EQ -ERROR@65018: expected EQ -ERROR@65229: expected EQ -ERROR@65428: expected EQ -ERROR@65620: expected EQ -ERROR@65873: expected EQ -ERROR@66121: expected EQ -ERROR@66331: expected EQ -ERROR@66388: expected EQ -ERROR@66599: expected EQ -ERROR@66661: expected EQ -ERROR@66846: expected EQ -ERROR@66904: expected EQ -ERROR@67084: expected EQ -ERROR@67147: expected EQ -ERROR@67363: expected EQ -ERROR@67559: expected EQ -ERROR@67831: expected EQ -ERROR@67890: expected EQ -ERROR@67954: expected EQ -ERROR@68011: expected EQ -ERROR@68073: expected EQ -ERROR@68291: expected EQ -ERROR@68343: expected EQ -ERROR@68817: expected EQ diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_limit.snap b/crates/squawk_parser/tests/snapshots/tests__regression_limit.snap deleted file mode 100644 index f4e9a4da..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_limit.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/limit.sql ---- -ERROR@973: expected SEMICOLON -ERROR@974: expected command, found LIMIT_KW -ERROR@980: expected command, found INT_NUMBER -ERROR@4758: expected ROWS_KW -ERROR@5405: expected SEMICOLON -ERROR@5406: expected command, found OFFSET_KW -ERROR@5413: expected command, found INT_NUMBER diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap b/crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap index 5445f80e..814887f4 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_numeric.snap @@ -2,14 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/numeric.sql --- -ERROR@32156: expected TYPE_KW -ERROR@32156: missing comma -ERROR@32186: expected TYPE_KW -ERROR@32186: missing comma -ERROR@32215: expected TYPE_KW -ERROR@32215: missing comma -ERROR@32242: expected TYPE_KW -ERROR@32242: missing comma ERROR@47483: expected FROM_KW ERROR@47483: expected L_PAREN ERROR@47483: expected an expression, found SEMICOLON diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_partition_prune.snap b/crates/squawk_parser/tests/snapshots/tests__regression_partition_prune.snap index 41a31608..e71a29f9 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_partition_prune.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_partition_prune.snap @@ -332,4 +332,3 @@ ERROR@62815: expected command, found IDENT ERROR@62817: expected command, found DOT ERROR@62818: expected command, found STAR ERROR@62820: expected command, found R_PAREN -ERROR@63651: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap b/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap index 343924e1..c015dbf8 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap @@ -2,6 +2,30 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/privileges.sql --- +ERROR@1281: missing comma +ERROR@1289: expected OPTION, TRUE, or FALSE +ERROR@1289: missing comma +ERROR@1292: expected OPTION, TRUE, or FALSE +ERROR@1292: missing comma +ERROR@1311: expected OPTION, TRUE, or FALSE +ERROR@1377: missing comma +ERROR@1385: expected OPTION, TRUE, or FALSE +ERROR@1385: missing comma +ERROR@1388: expected OPTION, TRUE, or FALSE +ERROR@1388: missing comma +ERROR@1407: expected OPTION, TRUE, or FALSE +ERROR@8877: missing comma +ERROR@8885: expected OPTION, TRUE, or FALSE +ERROR@8885: missing comma +ERROR@8888: expected OPTION, TRUE, or FALSE +ERROR@8888: missing comma +ERROR@8906: expected OPTION, TRUE, or FALSE +ERROR@9007: missing comma +ERROR@9015: expected OPTION, TRUE, or FALSE +ERROR@9015: missing comma +ERROR@9018: expected OPTION, TRUE, or FALSE +ERROR@9018: missing comma +ERROR@9031: expected OPTION, TRUE, or FALSE ERROR@17722: expected R_PAREN ERROR@17782: expected SEMICOLON ERROR@17782: expected command, found R_PAREN @@ -89,15 +113,3 @@ ERROR@65100: expected command, found DOT ERROR@65101: expected command, found IDENT ERROR@65118: expected command, found AS_KW ERROR@65121: expected command, found INT_KW -ERROR@74892: expected SEMICOLON -ERROR@74892: expected command, found COMMA -ERROR@74894: expected command, found ADMIN_KW -ERROR@74900: expected command, found TRUE_KW -ERROR@76186: expected SEMICOLON -ERROR@76186: expected command, found COMMA -ERROR@76191: expected name -ERROR@76191: expected EQ -ERROR@76286: expected SEMICOLON -ERROR@76286: expected command, found COMMA -ERROR@76291: expected name -ERROR@76291: expected EQ diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_psql.snap b/crates/squawk_parser/tests/snapshots/tests__regression_psql.snap index a18e8cb3..68a14d3e 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_psql.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_psql.snap @@ -703,80 +703,45 @@ ERROR@21261: expected SEMICOLON ERROR@21262: expected command, found ERROR ERROR@21432: expected SEMICOLON ERROR@21433: expected command, found ERROR -ERROR@22242: expected SEMICOLON -ERROR@22242: expected command, found COMMA -ERROR@22245: expected command, found INHERIT_KW -ERROR@22253: expected command, found TRUE_KW -ERROR@22257: expected command, found COMMA -ERROR@22263: expected name -ERROR@22263: expected EQ -ERROR@22268: expected SEMICOLON -ERROR@22270: expected command, found GRANTED_KW -ERROR@22278: expected command, found BY_KW -ERROR@22281: expected command, found IDENT -ERROR@22357: expected SEMICOLON -ERROR@22357: expected command, found COMMA -ERROR@22360: expected command, found INHERIT_KW -ERROR@22368: expected command, found FALSE_KW -ERROR@22373: expected command, found COMMA -ERROR@22378: expected name -ERROR@22378: expected EQ -ERROR@22384: expected SEMICOLON -ERROR@22385: expected command, found GRANTED_KW -ERROR@22393: expected command, found BY_KW -ERROR@22396: expected command, found IDENT -ERROR@22472: expected SEMICOLON -ERROR@22473: expected command, found COMMA -ERROR@22475: expected command, found INHERIT_KW -ERROR@22483: expected command, found FALSE_KW -ERROR@22488: expected command, found COMMA -ERROR@22493: expected name -ERROR@22493: expected EQ -ERROR@22498: expected SEMICOLON -ERROR@22500: expected command, found GRANTED_KW -ERROR@22508: expected command, found BY_KW -ERROR@22511: expected command, found IDENT -ERROR@22588: expected SEMICOLON -ERROR@22588: expected command, found COMMA -ERROR@22590: expected command, found INHERIT_KW -ERROR@22598: expected command, found TRUE_KW -ERROR@22602: expected command, found COMMA -ERROR@22608: expected name -ERROR@22608: expected EQ -ERROR@22614: expected SEMICOLON -ERROR@22615: expected command, found GRANTED_KW -ERROR@22623: expected command, found BY_KW -ERROR@22626: expected command, found IDENT -ERROR@22703: expected SEMICOLON -ERROR@22703: expected command, found COMMA -ERROR@22705: expected command, found INHERIT_KW -ERROR@22713: expected command, found TRUE_KW -ERROR@22718: expected command, found COMMA -ERROR@22723: expected name -ERROR@22723: expected EQ -ERROR@22728: expected SEMICOLON -ERROR@22730: expected command, found GRANTED_KW -ERROR@22738: expected command, found BY_KW -ERROR@22741: expected command, found IDENT -ERROR@22818: expected SEMICOLON -ERROR@22818: expected command, found COMMA -ERROR@22820: expected command, found INHERIT_KW -ERROR@22828: expected command, found FALSE_KW -ERROR@22833: expected command, found COMMA -ERROR@22838: expected name -ERROR@22838: expected EQ -ERROR@22843: expected SEMICOLON -ERROR@22845: expected command, found GRANTED_KW -ERROR@22853: expected command, found BY_KW -ERROR@22856: expected command, found IDENT -ERROR@22933: expected SEMICOLON -ERROR@22933: expected command, found COMMA -ERROR@22935: expected command, found INHERIT_KW -ERROR@22943: expected command, found FALSE_KW -ERROR@22948: expected command, found COMMA -ERROR@22953: expected name -ERROR@22953: expected EQ -ERROR@22959: expected SEMICOLON -ERROR@22960: expected command, found GRANTED_KW -ERROR@22968: expected command, found BY_KW -ERROR@22971: expected command, found IDENT +ERROR@22268: missing comma +ERROR@22277: expected OPTION, TRUE, or FALSE +ERROR@22277: missing comma +ERROR@22280: expected OPTION, TRUE, or FALSE +ERROR@22280: missing comma +ERROR@22297: expected OPTION, TRUE, or FALSE +ERROR@22384: missing comma +ERROR@22392: expected OPTION, TRUE, or FALSE +ERROR@22392: missing comma +ERROR@22395: expected OPTION, TRUE, or FALSE +ERROR@22395: missing comma +ERROR@22412: expected OPTION, TRUE, or FALSE +ERROR@22498: missing comma +ERROR@22507: expected OPTION, TRUE, or FALSE +ERROR@22507: missing comma +ERROR@22510: expected OPTION, TRUE, or FALSE +ERROR@22510: missing comma +ERROR@22527: expected OPTION, TRUE, or FALSE +ERROR@22614: missing comma +ERROR@22622: expected OPTION, TRUE, or FALSE +ERROR@22622: missing comma +ERROR@22625: expected OPTION, TRUE, or FALSE +ERROR@22625: missing comma +ERROR@22642: expected OPTION, TRUE, or FALSE +ERROR@22728: missing comma +ERROR@22737: expected OPTION, TRUE, or FALSE +ERROR@22737: missing comma +ERROR@22740: expected OPTION, TRUE, or FALSE +ERROR@22740: missing comma +ERROR@22757: expected OPTION, TRUE, or FALSE +ERROR@22843: missing comma +ERROR@22852: expected OPTION, TRUE, or FALSE +ERROR@22852: missing comma +ERROR@22855: expected OPTION, TRUE, or FALSE +ERROR@22855: missing comma +ERROR@22872: expected OPTION, TRUE, or FALSE +ERROR@22959: missing comma +ERROR@22967: expected OPTION, TRUE, or FALSE +ERROR@22967: missing comma +ERROR@22970: expected OPTION, TRUE, or FALSE +ERROR@22970: missing comma +ERROR@22987: expected OPTION, TRUE, or FALSE diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_publication.snap b/crates/squawk_parser/tests/snapshots/tests__regression_publication.snap index 86ccc936..b10af417 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_publication.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_publication.snap @@ -30,26 +30,6 @@ ERROR@12538: expected command, found IDENT ERROR@12540: expected command, found L_ANGLE ERROR@12542: expected command, found INT_NUMBER ERROR@12544: expected command, found R_PAREN -ERROR@12743: expected STORED_KW -ERROR@12743: expected R_PAREN -ERROR@12743: expected SEMICOLON -ERROR@12744: expected command, found VIRTUAL_KW -ERROR@12751: expected command, found R_PAREN -ERROR@13030: expected STORED_KW -ERROR@13030: expected R_PAREN -ERROR@13030: expected SEMICOLON -ERROR@13031: expected command, found VIRTUAL_KW -ERROR@13038: expected command, found R_PAREN -ERROR@20613: expected STORED_KW -ERROR@20613: expected R_PAREN -ERROR@20613: expected SEMICOLON -ERROR@20614: expected command, found VIRTUAL_KW -ERROR@20621: expected command, found R_PAREN -ERROR@21979: expected STORED_KW -ERROR@21979: expected R_PAREN -ERROR@21979: expected SEMICOLON -ERROR@21980: expected command, found VIRTUAL_KW -ERROR@21988: expected command, found R_PAREN ERROR@29346: expected name ERROR@29346: expected SEMICOLON ERROR@29372: expected SEMICOLON diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap index 00860e81..f5b087b1 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap @@ -2,7 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/rowsecurity.sql --- -ERROR@10060: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT ERROR@19198: expected R_PAREN ERROR@19263: expected SEMICOLON ERROR@19263: expected command, found R_PAREN @@ -78,14 +77,6 @@ ERROR@58119: expected R_PAREN ERROR@62112: expected type name ERROR@62639: expected type name ERROR@63728: expected type name -ERROR@70090: expected STORED_KW -ERROR@70090: expected R_PAREN -ERROR@70090: expected SEMICOLON -ERROR@70091: expected command, found VIRTUAL_KW -ERROR@70098: expected command, found R_PAREN -ERROR@70155: expected STORED_KW -ERROR@70155: expected SEMICOLON -ERROR@70156: expected command, found VIRTUAL_KW ERROR@79066: expected SEMICOLON ERROR@79066: expected command, found DOT ERROR@79067: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rowtypes.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rowtypes.snap deleted file mode 100644 index 80289f99..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rowtypes.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/rowtypes.sql ---- -ERROR@1874: expected EQ -ERROR@1874: expected an expression, found DOT -ERROR@1875: expected expression -ERROR@1875: expected SEMICOLON -ERROR@1875: expected command, found IDENT -ERROR@1882: expected command, found EQ -ERROR@1884: expected command, found STRING -ERROR@1998: expected EQ -ERROR@1998: expected an expression, found DOT -ERROR@1999: expected expression -ERROR@1999: expected SEMICOLON -ERROR@1999: expected command, found IDENT -ERROR@2001: expected command, found DOT -ERROR@2002: expected command, found IDENT -ERROR@2004: expected command, found EQ -ERROR@2006: expected command, found INT_NUMBER -ERROR@2009: expected command, found WHERE_KW -ERROR@2015: expected command, found IDENT -ERROR@2018: expected command, found EQ -ERROR@2020: expected command, found INT_NUMBER -ERROR@2046: expected EQ -ERROR@2046: expected an expression, found DOT -ERROR@2047: expected expression -ERROR@2047: expected SEMICOLON -ERROR@2047: expected command, found IDENT -ERROR@2050: expected command, found EQ -ERROR@2052: expected command, found INT_NUMBER -ERROR@2628: expected EQ -ERROR@2628: expected an expression, found DOT -ERROR@2629: expected expression -ERROR@2629: expected SEMICOLON -ERROR@2629: expected command, found FIRST_KW -ERROR@2635: expected command, found EQ -ERROR@2637: expected command, found STRING diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap index 9ab8c4dd..ed3ffc54 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap @@ -33,34 +33,8 @@ ERROR@6179: expected command, found INT_NUMBER ERROR@6181: expected command, found IDENT ERROR@6186: expected command, found IDENT ERROR@6190: expected command, found IDENT -ERROR@34361: expected R_PAREN -ERROR@34361: expected EQ -ERROR@34361: expected SEMICOLON -ERROR@34361: expected command, found L_BRACK -ERROR@34362: expected command, found INT_NUMBER -ERROR@34363: expected command, found R_BRACK -ERROR@34364: expected command, found COMMA -ERROR@34366: expected command, found IDENT -ERROR@34368: expected command, found COMMA -ERROR@34370: expected command, found IDENT -ERROR@34373: expected command, found R_PAREN -ERROR@34375: expected command, found EQ -ERROR@34420: expected SEMICOLON -ERROR@34423: expected command, found WHERE_KW -ERROR@34429: expected command, found IDENT -ERROR@34433: expected command, found DOT -ERROR@34434: expected command, found IDENT -ERROR@34437: expected command, found EQ -ERROR@34439: expected command, found NEW_KW -ERROR@34442: expected command, found DOT -ERROR@34443: expected command, found IDENT -ERROR@34446: expected command, found RETURNING_KW -ERROR@34456: expected command, found NEW_KW -ERROR@34459: expected command, found DOT -ERROR@34460: expected command, found STAR ERROR@35833: expected SELECT, got VALUES ERROR@35940: expected SELECT, got VALUES -ERROR@42847: expected EQ ERROR@43268: expected an expression, found WITH_KW ERROR@43272: expected output expression ERROR@43273: expected command, found L_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap b/crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap index 61ceb1e6..b6d4dfd2 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap @@ -22,4 +22,3 @@ ERROR@2434: expected type name ERROR@2438: expected type name ERROR@2520: expected type name ERROR@2589: expected type name -ERROR@3762: expected SELECT, got SELECT_INTO diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_select_parallel.snap b/crates/squawk_parser/tests/snapshots/tests__regression_select_parallel.snap index 5a0d9b13..089d7e23 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_select_parallel.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_select_parallel.snap @@ -2,7 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/select_parallel.sql --- -ERROR@15485: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT ERROR@18384: expected R_PAREN ERROR@18424: expected SEMICOLON ERROR@18424: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_stats_ext.snap b/crates/squawk_parser/tests/snapshots/tests__regression_stats_ext.snap index 7634c362..5c41f0d1 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_stats_ext.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_stats_ext.snap @@ -6,14 +6,6 @@ ERROR@876: expected FROM_KW ERROR@876: expected path name ERROR@907: expected FROM_KW ERROR@907: expected path name -ERROR@1972: expected STORED_KW -ERROR@1972: expected R_PAREN -ERROR@1972: expected SEMICOLON -ERROR@1973: expected command, found VIRTUAL_KW -ERROR@1980: expected command, found COMMA -ERROR@1982: expected command, found IDENT -ERROR@1984: expected command, found IDENT -ERROR@1987: expected command, found R_PAREN ERROR@4859: expected OWNER, RENAME, or SET ERROR@4859: expected SEMICOLON ERROR@4860: expected command, found EXISTS_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap b/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap index 25870d8a..6bc64c34 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap @@ -2,8 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/subselect.sql --- -ERROR@4054: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@4116: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT ERROR@31606: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: L_PAREN ERROR@31606: expected R_PAREN ERROR@31606: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap index ecec20e1..e3dbfab6 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap @@ -4,12 +4,11 @@ expression: "out.join(\"\\n\")" --- tests/snapshots/tests__regression_alter_generic.snap:13 tests/snapshots/tests__regression_alter_table.snap:136 -tests/snapshots/tests__regression_arrays.snap:488 +tests/snapshots/tests__regression_arrays.snap:5 tests/snapshots/tests__regression_btree_index.snap:66 tests/snapshots/tests__regression_cluster.snap:19 -tests/snapshots/tests__regression_collate.icu.utf8.snap:56 -tests/snapshots/tests__regression_collate.linux.utf8.snap:34 -tests/snapshots/tests__regression_collate.snap:3 +tests/snapshots/tests__regression_collate.icu.utf8.snap:53 +tests/snapshots/tests__regression_collate.linux.utf8.snap:31 tests/snapshots/tests__regression_constraints.snap:538 tests/snapshots/tests__regression_copy.snap:231 tests/snapshots/tests__regression_copy2.snap:58 @@ -19,71 +18,59 @@ tests/snapshots/tests__regression_create_aggregate.snap:45 tests/snapshots/tests__regression_create_am.snap:14 tests/snapshots/tests__regression_create_function_sql.snap:15 tests/snapshots/tests__regression_create_index.snap:22 -tests/snapshots/tests__regression_create_misc.snap:2 tests/snapshots/tests__regression_create_operator.snap:17 -tests/snapshots/tests__regression_create_role.snap:4 -tests/snapshots/tests__regression_create_schema.snap:3 tests/snapshots/tests__regression_create_table.snap:31 -tests/snapshots/tests__regression_create_table_like.snap:50 -tests/snapshots/tests__regression_create_type.snap:1 +tests/snapshots/tests__regression_create_table_like.snap:45 tests/snapshots/tests__regression_create_view.snap:265 -tests/snapshots/tests__regression_domain.snap:215 +tests/snapshots/tests__regression_domain.snap:48 tests/snapshots/tests__regression_drop_if_exists.snap:22 tests/snapshots/tests__regression_errors.snap:286 -tests/snapshots/tests__regression_event_trigger.snap:7 -tests/snapshots/tests__regression_fast_default.snap:6 tests/snapshots/tests__regression_foreign_data.snap:57 tests/snapshots/tests__regression_foreign_key.snap:92 -tests/snapshots/tests__regression_generated_stored.snap:44 -tests/snapshots/tests__regression_generated_virtual.snap:600 +tests/snapshots/tests__regression_generated_stored.snap:17 +tests/snapshots/tests__regression_generated_virtual.snap:36 tests/snapshots/tests__regression_groupingsets.snap:97 tests/snapshots/tests__regression_guc.snap:81 tests/snapshots/tests__regression_horology.snap:173 -tests/snapshots/tests__regression_incremental_sort.snap:1 -tests/snapshots/tests__regression_inherit.snap:307 +tests/snapshots/tests__regression_inherit.snap:304 tests/snapshots/tests__regression_insert.snap:19 -tests/snapshots/tests__regression_insert_conflict.snap:260 -tests/snapshots/tests__regression_int2.snap:2 -tests/snapshots/tests__regression_int4.snap:4 -tests/snapshots/tests__regression_int8.snap:8 +tests/snapshots/tests__regression_insert_conflict.snap:253 tests/snapshots/tests__regression_interval.snap:2 -tests/snapshots/tests__regression_join.snap:21 +tests/snapshots/tests__regression_join.snap:20 tests/snapshots/tests__regression_json.snap:12 -tests/snapshots/tests__regression_jsonb.snap:43 +tests/snapshots/tests__regression_jsonb.snap:8 tests/snapshots/tests__regression_largeobject.snap:12 -tests/snapshots/tests__regression_limit.snap:7 tests/snapshots/tests__regression_matview.snap:6 tests/snapshots/tests__regression_merge.snap:384 tests/snapshots/tests__regression_misc.snap:26 tests/snapshots/tests__regression_misc_functions.snap:9 tests/snapshots/tests__regression_namespace.snap:7 -tests/snapshots/tests__regression_numeric.snap:13 +tests/snapshots/tests__regression_numeric.snap:5 tests/snapshots/tests__regression_numerology.snap:6 tests/snapshots/tests__regression_object_address.snap:14 tests/snapshots/tests__regression_oidjoins.snap:3 tests/snapshots/tests__regression_partition_join.snap:2 -tests/snapshots/tests__regression_partition_prune.snap:331 +tests/snapshots/tests__regression_partition_prune.snap:330 tests/snapshots/tests__regression_plpgsql.snap:590 -tests/snapshots/tests__regression_privileges.snap:99 -tests/snapshots/tests__regression_psql.snap:778 +tests/snapshots/tests__regression_privileges.snap:111 +tests/snapshots/tests__regression_psql.snap:743 tests/snapshots/tests__regression_psql_crosstab.snap:115 tests/snapshots/tests__regression_psql_pipeline.snap:649 -tests/snapshots/tests__regression_publication.snap:91 +tests/snapshots/tests__regression_publication.snap:71 tests/snapshots/tests__regression_rangefuncs.snap:290 tests/snapshots/tests__regression_returning.snap:230 -tests/snapshots/tests__regression_rowsecurity.snap:87 -tests/snapshots/tests__regression_rowtypes.snap:34 -tests/snapshots/tests__regression_rules.snap:85 -tests/snapshots/tests__regression_select_into.snap:21 -tests/snapshots/tests__regression_select_parallel.snap:4 +tests/snapshots/tests__regression_rowsecurity.snap:78 +tests/snapshots/tests__regression_rules.snap:59 +tests/snapshots/tests__regression_select_into.snap:20 +tests/snapshots/tests__regression_select_parallel.snap:3 tests/snapshots/tests__regression_sqljson.snap:1075 tests/snapshots/tests__regression_sqljson_jsontable.snap:186 tests/snapshots/tests__regression_sqljson_queryfuncs.snap:52 tests/snapshots/tests__regression_stats.snap:34 -tests/snapshots/tests__regression_stats_ext.snap:17 +tests/snapshots/tests__regression_stats_ext.snap:9 tests/snapshots/tests__regression_strings.snap:533 tests/snapshots/tests__regression_subscription.snap:4 -tests/snapshots/tests__regression_subselect.snap:54 +tests/snapshots/tests__regression_subselect.snap:52 tests/snapshots/tests__regression_tablesample.snap:6 tests/snapshots/tests__regression_tablespace.snap:12 tests/snapshots/tests__regression_temp.snap:16 @@ -94,11 +81,9 @@ tests/snapshots/tests__regression_triggers.snap:51 tests/snapshots/tests__regression_tsearch.snap:62 tests/snapshots/tests__regression_tuplesort.snap:188 tests/snapshots/tests__regression_unicode.snap:40 -tests/snapshots/tests__regression_union.snap:51 -tests/snapshots/tests__regression_updatable_views.snap:4 -tests/snapshots/tests__regression_update.snap:46 +tests/snapshots/tests__regression_union.snap:25 +tests/snapshots/tests__regression_update.snap:29 tests/snapshots/tests__regression_vacuum.snap:21 tests/snapshots/tests__regression_window.snap:72 tests/snapshots/tests__regression_with.snap:27 -tests/snapshots/tests__regression_write_parallel.snap:1 tests/snapshots/tests__regression_xml.snap:623 diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_union.snap b/crates/squawk_parser/tests/snapshots/tests__regression_union.snap index 9fb35117..f49f0fa7 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_union.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_union.snap @@ -16,28 +16,6 @@ ERROR@1855: expected command, found IDENT ERROR@1864: expected command, found ORDER_KW ERROR@1870: expected command, found BY_KW ERROR@1873: expected command, found INT_NUMBER -ERROR@3552: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@3829: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@4524: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@4722: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@4939: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@5113: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@5315: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@5581: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@5848: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@6165: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@6488: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@6754: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@7021: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@7338: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@7588: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@7839: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@8280: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@8734: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@9076: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@9326: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@9577: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@9883: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT ERROR@10339: expected SEMICOLON ERROR@10340: expected command, found ORDER_KW ERROR@10346: expected command, found BY_KW @@ -46,10 +24,6 @@ ERROR@11233: expected SEMICOLON ERROR@11234: expected command, found ORDER_KW ERROR@11240: expected command, found BY_KW ERROR@11243: expected command, found INT_NUMBER -ERROR@11830: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@12396: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@12493: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT -ERROR@18725: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got COMPOUND_SELECT ERROR@18725: expected SEMICOLON ERROR@18726: expected command, found LIMIT_KW ERROR@18732: expected command, found INT_NUMBER diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_updatable_views.snap b/crates/squawk_parser/tests/snapshots/tests__regression_updatable_views.snap deleted file mode 100644 index 985c81a6..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_updatable_views.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/updatable_views.sql ---- -ERROR@42218: expected EQ -ERROR@42231: expected EQ -ERROR@51109: expected EQ -ERROR@51161: expected EQ diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_update.snap b/crates/squawk_parser/tests/snapshots/tests__regression_update.snap index db74713a..926671e5 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_update.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_update.snap @@ -2,23 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/update.sql --- -ERROR@668: expected EQ -ERROR@668: expected an expression, found DOT -ERROR@669: expected expression -ERROR@669: expected SEMICOLON -ERROR@669: expected command, found IDENT -ERROR@671: expected command, found EQ -ERROR@673: expected command, found IDENT -ERROR@674: expected command, found DOT -ERROR@675: expected command, found IDENT -ERROR@677: expected command, found PLUS -ERROR@679: expected command, found INT_NUMBER -ERROR@682: expected command, found WHERE_KW -ERROR@688: expected command, found IDENT -ERROR@689: expected command, found DOT -ERROR@690: expected command, found IDENT -ERROR@692: expected command, found EQ -ERROR@694: expected command, found INT_NUMBER ERROR@8287: expected command, found STRING ERROR@8308: expected command, found STRING ERROR@9069: expected command, found STRING diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_write_parallel.snap b/crates/squawk_parser/tests/snapshots/tests__regression_write_parallel.snap deleted file mode 100644 index 710b8050..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_write_parallel.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/write_parallel.sql ---- -ERROR@637: expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got SELECT_INTO diff --git a/crates/squawk_parser/tests/snapshots/tests__select_ok.snap b/crates/squawk_parser/tests/snapshots/tests__select_ok.snap index 73476551..b2cfb600 100644 --- a/crates/squawk_parser/tests/snapshots/tests__select_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__select_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/select.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- parens_and_unions" @@ -4036,16 +4035,17 @@ SOURCE_FILE LITERAL INT_NUMBER "1" WHITESPACE " " - FETCH_KW "fetch" - WHITESPACE " " - FIRST_KW "first" - WHITESPACE " " - LITERAL - INT_NUMBER "3" - WHITESPACE " " - ROWS_KW "rows" - WHITESPACE " " - ONLY_KW "only" + FETCH_CLAUSE + FETCH_KW "fetch" + WHITESPACE " " + FIRST_KW "first" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + WHITESPACE " " + ROWS_KW "rows" + WHITESPACE " " + ONLY_KW "only" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- next" @@ -4067,18 +4067,19 @@ SOURCE_FILE LITERAL INT_NUMBER "1" WHITESPACE " " - FETCH_KW "fetch" - WHITESPACE " " - NEXT_KW "next" - WHITESPACE " " - LITERAL - INT_NUMBER "1" - WHITESPACE " " - ROW_KW "row" - WHITESPACE " " - WITH_KW "with" - WHITESPACE " " - TIES_KW "ties" + FETCH_CLAUSE + FETCH_KW "fetch" + WHITESPACE " " + NEXT_KW "next" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + WHITESPACE " " + ROW_KW "row" + WHITESPACE " " + WITH_KW "with" + WHITESPACE " " + TIES_KW "ties" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- simple_expr" diff --git a/crates/squawk_syntax/src/ast/generated/nodes.rs b/crates/squawk_syntax/src/ast/generated/nodes.rs index 70266445..631e5a97 100644 --- a/crates/squawk_syntax/src/ast/generated/nodes.rs +++ b/crates/squawk_syntax/src/ast/generated/nodes.rs @@ -1112,6 +1112,10 @@ pub struct ArrayType { pub(crate) syntax: SyntaxNode, } impl ArrayType { + #[inline] + pub fn expr(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) @@ -1121,6 +1125,14 @@ impl ArrayType { support::child(&self.syntax) } #[inline] + pub fn l_brack_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::L_BRACK) + } + #[inline] + pub fn r_brack_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::R_BRACK) + } + #[inline] pub fn array_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::ARRAY_KW) } @@ -1401,6 +1413,10 @@ pub struct CheckConstraint { pub(crate) syntax: SyntaxNode, } impl CheckConstraint { + #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn expr(&self) -> Option { support::child(&self.syntax) @@ -2854,11 +2870,23 @@ pub struct DefaultConstraint { pub(crate) syntax: SyntaxNode, } impl DefaultConstraint { + #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn expr(&self) -> Option { support::child(&self.syntax) } #[inline] + pub fn name_ref(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn constraint_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CONSTRAINT_KW) + } + #[inline] pub fn default_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DEFAULT_KW) } @@ -4412,6 +4440,17 @@ impl Fetch { } } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct FetchClause { + pub(crate) syntax: SyntaxNode, +} +impl FetchClause { + #[inline] + pub fn fetch_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::FETCH_KW) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct FieldExpr { pub(crate) syntax: SyntaxNode, @@ -4491,7 +4530,11 @@ pub struct ForeignKeyConstraint { } impl ForeignKeyConstraint { #[inline] - pub fn column_list(&self) -> Option { + pub fn from_columns(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn match_type(&self) -> Option { support::child(&self.syntax) } #[inline] @@ -4507,33 +4550,21 @@ impl ForeignKeyConstraint { support::child(&self.syntax) } #[inline] - pub fn foreign_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::FOREIGN_KW) + pub fn to_columns(&self) -> Option { + support::child(&self.syntax) } #[inline] - pub fn full_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::FULL_KW) + pub fn foreign_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::FOREIGN_KW) } #[inline] pub fn key_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::KEY_KW) } #[inline] - pub fn match_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::MATCH_KW) - } - #[inline] - pub fn partial_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::PARTIAL_KW) - } - #[inline] pub fn references_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::REFERENCES_KW) } - #[inline] - pub fn simple_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::SIMPLE_KW) - } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -4563,6 +4594,10 @@ pub struct GeneratedConstraint { pub(crate) syntax: SyntaxNode, } impl GeneratedConstraint { + #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn expr(&self) -> Option { support::child(&self.syntax) @@ -5316,6 +5351,51 @@ impl Lteq { } } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct MatchFull { + pub(crate) syntax: SyntaxNode, +} +impl MatchFull { + #[inline] + pub fn full_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::FULL_KW) + } + #[inline] + pub fn match_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::MATCH_KW) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct MatchPartial { + pub(crate) syntax: SyntaxNode, +} +impl MatchPartial { + #[inline] + pub fn match_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::MATCH_KW) + } + #[inline] + pub fn partial_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::PARTIAL_KW) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct MatchSimple { + pub(crate) syntax: SyntaxNode, +} +impl MatchSimple { + #[inline] + pub fn match_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::MATCH_KW) + } + #[inline] + pub fn simple_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::SIMPLE_KW) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Merge { pub(crate) syntax: SyntaxNode, @@ -5531,6 +5611,10 @@ pub struct NotNullConstraint { pub(crate) syntax: SyntaxNode, } impl NotNullConstraint { + #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) @@ -5595,6 +5679,10 @@ pub struct NullConstraint { pub(crate) syntax: SyntaxNode, } impl NullConstraint { + #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) @@ -6195,6 +6283,10 @@ impl PrimaryKeyConstraint { support::child(&self.syntax) } #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } + #[inline] pub fn index_params(&self) -> Option { support::child(&self.syntax) } @@ -6296,11 +6388,27 @@ pub struct ReferencesConstraint { pub(crate) syntax: SyntaxNode, } impl ReferencesConstraint { + #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn match_type(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) } #[inline] + pub fn on_delete_action(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn on_update_action(&self) -> Option { + support::child(&self.syntax) + } + #[inline] pub fn path(&self) -> Option { support::child(&self.syntax) } @@ -6317,25 +6425,9 @@ impl ReferencesConstraint { support::token(&self.syntax, SyntaxKind::CONSTRAINT_KW) } #[inline] - pub fn full_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::FULL_KW) - } - #[inline] - pub fn match_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::MATCH_KW) - } - #[inline] - pub fn partial_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::PARTIAL_KW) - } - #[inline] pub fn references_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::REFERENCES_KW) } - #[inline] - pub fn simple_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::SIMPLE_KW) - } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -6782,6 +6874,10 @@ pub struct Select { pub(crate) syntax: SyntaxNode, } impl Select { + #[inline] + pub fn fetch_clause(&self) -> Option { + support::child(&self.syntax) + } #[inline] pub fn filter_clause(&self) -> Option { support::child(&self.syntax) @@ -7706,6 +7802,10 @@ impl UniqueConstraint { support::child(&self.syntax) } #[inline] + pub fn constraint_option_list(&self) -> Option { + support::child(&self.syntax) + } + #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) } @@ -8149,6 +8249,13 @@ pub enum FuncOption { WindowFuncOption(WindowFuncOption), } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum MatchType { + MatchFull(MatchFull), + MatchPartial(MatchPartial), + MatchSimple(MatchSimple), +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ParamMode { ParamIn(ParamIn), @@ -12127,6 +12234,24 @@ impl AstNode for Fetch { &self.syntax } } +impl AstNode for FetchClause { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + kind == SyntaxKind::FETCH_CLAUSE + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } +} impl AstNode for FieldExpr { #[inline] fn can_cast(kind: SyntaxKind) -> bool { @@ -12973,6 +13098,60 @@ impl AstNode for Lteq { &self.syntax } } +impl AstNode for MatchFull { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + kind == SyntaxKind::MATCH_FULL + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } +} +impl AstNode for MatchPartial { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + kind == SyntaxKind::MATCH_PARTIAL + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } +} +impl AstNode for MatchSimple { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + kind == SyntaxKind::MATCH_SIMPLE + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } +} impl AstNode for Merge { #[inline] fn can_cast(kind: SyntaxKind) -> bool { @@ -16779,6 +16958,53 @@ impl From for FuncOption { FuncOption::WindowFuncOption(node) } } +impl AstNode for MatchType { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + matches!( + kind, + SyntaxKind::MATCH_FULL | SyntaxKind::MATCH_PARTIAL | SyntaxKind::MATCH_SIMPLE + ) + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + let res = match syntax.kind() { + SyntaxKind::MATCH_FULL => MatchType::MatchFull(MatchFull { syntax }), + SyntaxKind::MATCH_PARTIAL => MatchType::MatchPartial(MatchPartial { syntax }), + SyntaxKind::MATCH_SIMPLE => MatchType::MatchSimple(MatchSimple { syntax }), + _ => { + return None; + } + }; + Some(res) + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + match self { + MatchType::MatchFull(it) => &it.syntax, + MatchType::MatchPartial(it) => &it.syntax, + MatchType::MatchSimple(it) => &it.syntax, + } + } +} +impl From for MatchType { + #[inline] + fn from(node: MatchFull) -> MatchType { + MatchType::MatchFull(node) + } +} +impl From for MatchType { + #[inline] + fn from(node: MatchPartial) -> MatchType { + MatchType::MatchPartial(node) + } +} +impl From for MatchType { + #[inline] + fn from(node: MatchSimple) -> MatchType { + MatchType::MatchSimple(node) + } +} impl AstNode for ParamMode { #[inline] fn can_cast(kind: SyntaxKind) -> bool { diff --git a/crates/squawk_syntax/src/postgresql.ungram b/crates/squawk_syntax/src/postgresql.ungram index 55da8beb..cd4a90f5 100644 --- a/crates/squawk_syntax/src/postgresql.ungram +++ b/crates/squawk_syntax/src/postgresql.ungram @@ -450,6 +450,9 @@ WindowClause = LimitClause = 'limit' +FetchClause = + 'fetch' + OffsetClause = 'offset' @@ -520,6 +523,7 @@ Select = OrderByClause? LockingClause* LimitClause? + FetchClause? OffsetClause? FilterClause?