From a8c4b68c1bbda3c4f9ade1f7f98f703da88e48de Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Wed, 4 Jun 2025 23:32:39 -0400 Subject: [PATCH] parser: fix more pg test suite errors part 8 fixes trim usages & values in CTEs --- .vscode/extensions.json | 14 ++ .vscode/settings.json | 5 +- crates/squawk_parser/src/grammar.rs | 36 +-- .../tests/data/regression_suite/vacuum.sql | 4 +- .../tests/data/regression_suite/with.sql | 4 +- .../tests__regression_create_view.snap | 215 ------------------ .../tests__regression_partition_prune.snap | 4 +- .../tests__regression_rangefuncs.snap | 18 +- .../tests__regression_returning.snap | 2 +- .../snapshots/tests__regression_rules.snap | 2 +- .../snapshots/tests__regression_sqljson.snap | 45 ++-- .../snapshots/tests__regression_strings.snap | 44 ---- .../tests__regression_subselect.snap | 8 - .../tests__regression_suite_errors.snap | 13 +- .../snapshots/tests__regression_union.snap | 10 - .../snapshots/tests__regression_vacuum.snap | 6 - .../snapshots/tests__regression_with.snap | 20 +- 17 files changed, 80 insertions(+), 370 deletions(-) create mode 100644 .vscode/extensions.json delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_create_view.snap diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..de8f5504 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,14 @@ +{ + "recommendations": [ + "ckolkman.vscode-postgres", + "rust-lang.rust-analyzer", + "usernamehw.errorlens", + "dbaeumer.vscode-eslint", + "mitsuhiko.insta", + "esbenp.prettier-vscode", + "vitest.explorer", + "binhtran432k.ungrammar-language-features", + "sleistner.vscode-fileutils", + "tamasfe.even-better-toml" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index c29eb164..aa59d42c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,10 @@ "[rust]": { "editor.defaultFormatter": "rust-lang.rust-analyzer" }, - "[sql]": { + "files.associations": { + "*.sql": "postgres" + }, + "[postgres]": { "editor.tabSize": 2 }, "[ungrammar]": { diff --git a/crates/squawk_parser/src/grammar.rs b/crates/squawk_parser/src/grammar.rs index 47d5c8b1..6f806310 100644 --- a/crates/squawk_parser/src/grammar.rs +++ b/crates/squawk_parser/src/grammar.rs @@ -286,26 +286,26 @@ fn position_fn(p: &mut Parser<'_>) -> CompletedMarker { fn trim_fn(p: &mut Parser<'_>) -> CompletedMarker { assert!(p.at(TRIM_KW)); custom_fn(p, TRIM_KW, |p| { - if p.eat(BOTH_KW) { + let _ = p.eat(BOTH_KW) || p.eat(LEADING_KW) || p.eat(TRAILING_KW); + // | FROM expr_list + // | a_expr FROM expr_list + // | expr_list + if p.eat(FROM_KW) { + if !expr_list(p) { + p.error("expected expression") + } + } else { + if expr(p).is_none() { + p.error("expected expression"); + } if p.eat(FROM_KW) { - if expr(p).is_none() { - p.error("expected an expression"); - } + expr_list(p); } else { - if expr(p).is_none() { - p.error("expected an expression"); - } - if p.eat(FROM_KW) && expr(p).is_none() { - p.error("expected an expression"); + if p.eat(COMMA) { + expr_list(p); } } - } else if p.eat(LEADING_KW) || p.eat(TRAILING_KW) { - if expr(p).is_none() { - p.error("expected an expression"); - } - } else if expr(p).is_none() { - p.error("expected an expression"); - } + }; }) } @@ -11970,14 +11970,14 @@ fn with(p: &mut Parser<'_>, m: Option) -> Option { with_query_clause(p); match p.current() { DELETE_KW => Some(delete(p, Some(m))), - SELECT_KW | TABLE_KW => select(p, Some(m)), + SELECT_KW | TABLE_KW | VALUES_KW => select(p, Some(m)), INSERT_KW => Some(insert(p, Some(m))), UPDATE_KW => Some(update(p, Some(m))), MERGE_KW => Some(merge(p, Some(m))), _ => { m.abandon(p); p.error(format!( - "expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: {:?}", + "expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: {:?}", p.current() )); None diff --git a/crates/squawk_parser/tests/data/regression_suite/vacuum.sql b/crates/squawk_parser/tests/data/regression_suite/vacuum.sql index 9b8cf0be..45bd9147 100644 --- a/crates/squawk_parser/tests/data/regression_suite/vacuum.sql +++ b/crates/squawk_parser/tests/data/regression_suite/vacuum.sql @@ -324,8 +324,8 @@ DROP TABLE only_inh_parent CASCADE; -- parenthesized syntax for ANALYZE ANALYZE (VERBOSE) does_not_exist; -ANALYZE (nonexistent-arg) does_not_exist; -ANALYZE (nonexistentarg) does_not_exit; +-- ANALYZE (nonexistent-arg) does_not_exist; +-- ANALYZE (nonexistentarg) does_not_exit; -- ensure argument order independence, and that SKIP_LOCKED on non-existing -- relation still errors out. Suppress WARNING messages caused by concurrent diff --git a/crates/squawk_parser/tests/data/regression_suite/with.sql b/crates/squawk_parser/tests/data/regression_suite/with.sql index feecfa18..f811c447 100644 --- a/crates/squawk_parser/tests/data/regression_suite/with.sql +++ b/crates/squawk_parser/tests/data/regression_suite/with.sql @@ -1703,8 +1703,8 @@ VALUES(FALSE); DROP RULE y_rule ON y; -- check that parser lookahead for WITH doesn't cause any odd behavior -create table foo (with baz); -- fail, WITH is a reserved word -create table foo (with ordinality); -- fail, WITH is a reserved word +-- create table foo (with baz); -- fail, WITH is a reserved word +-- create table foo (with ordinality); -- fail, WITH is a reserved word with ordinality as (select 1 as x) select * from ordinality; -- check sane response to attempt to modify CTE relation diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_view.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_view.snap deleted file mode 100644 index 33a46f2b..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_view.snap +++ /dev/null @@ -1,215 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_view.sql ---- -ERROR@22280: expected R_PAREN -ERROR@22285: expected from item, got STRING -ERROR@22285: expected SEMICOLON -ERROR@22286: expected command, found STRING -ERROR@22293: expected command, found R_PAREN -ERROR@22295: expected command, found AS_KW -ERROR@22298: expected command, found IDENT -ERROR@22300: expected command, found COMMA -ERROR@22304: expected command, found TRIM_KW -ERROR@22308: expected command, found L_PAREN -ERROR@22309: expected command, found LEADING_KW -ERROR@22317: expected command, found STRING -ERROR@22321: expected command, found FROM_KW -ERROR@22326: expected command, found STRING -ERROR@22333: expected command, found R_PAREN -ERROR@22335: expected command, found AS_KW -ERROR@22338: expected command, found IDENT -ERROR@22340: expected command, found COMMA -ERROR@22344: expected command, found TRIM_KW -ERROR@22348: expected command, found L_PAREN -ERROR@22349: expected command, found TRAILING_KW -ERROR@22358: expected command, found STRING -ERROR@22365: expected command, found R_PAREN -ERROR@22367: expected command, found AS_KW -ERROR@22370: expected command, found IDENT -ERROR@22372: expected command, found COMMA -ERROR@22376: expected command, found TRIM_KW -ERROR@22380: expected command, found L_PAREN -ERROR@22381: expected command, found ESC_STRING -ERROR@22389: expected command, found COLON -ERROR@22390: expected command, found COLON -ERROR@22391: expected command, found IDENT -ERROR@22397: expected command, found FROM_KW -ERROR@22402: expected command, found ESC_STRING -ERROR@22418: expected command, found COLON -ERROR@22419: expected command, found COLON -ERROR@22420: expected command, found IDENT -ERROR@22425: expected command, found R_PAREN -ERROR@22427: expected command, found AS_KW -ERROR@22430: expected command, found IDENT -ERROR@22433: expected command, found COMMA -ERROR@22437: expected command, found TRIM_KW -ERROR@22441: expected command, found L_PAREN -ERROR@22442: expected command, found LEADING_KW -ERROR@22450: expected command, found ESC_STRING -ERROR@22458: expected command, found COLON -ERROR@22459: expected command, found COLON -ERROR@22460: expected command, found IDENT -ERROR@22466: expected command, found FROM_KW -ERROR@22471: expected command, found ESC_STRING -ERROR@22487: expected command, found COLON -ERROR@22488: expected command, found COLON -ERROR@22489: expected command, found IDENT -ERROR@22494: expected command, found R_PAREN -ERROR@22496: expected command, found AS_KW -ERROR@22499: expected command, found IDENT -ERROR@22502: expected command, found COMMA -ERROR@22506: expected command, found TRIM_KW -ERROR@22510: expected command, found L_PAREN -ERROR@22511: expected command, found TRAILING_KW -ERROR@22520: expected command, found ESC_STRING -ERROR@22528: expected command, found COLON -ERROR@22529: expected command, found COLON -ERROR@22530: expected command, found IDENT -ERROR@22536: expected command, found FROM_KW -ERROR@22541: expected command, found ESC_STRING -ERROR@22557: expected command, found COLON -ERROR@22558: expected command, found COLON -ERROR@22559: expected command, found IDENT -ERROR@22564: expected command, found R_PAREN -ERROR@22566: expected command, found AS_KW -ERROR@22569: expected command, found IDENT -ERROR@22572: expected command, found COMMA -ERROR@22576: expected command, found CURRENT_DATE_KW -ERROR@22589: expected command, found AS_KW -ERROR@22592: expected command, found IDENT -ERROR@22594: expected command, found COMMA -ERROR@22626: expected SEMICOLON -ERROR@22627: expected command, found AS_KW -ERROR@22630: expected command, found IDENT -ERROR@22633: expected command, found COMMA -ERROR@22637: expected command, found CURRENT_TIME_KW -ERROR@22650: expected command, found AS_KW -ERROR@22653: expected command, found IDENT -ERROR@22655: expected command, found COMMA -ERROR@22687: expected SEMICOLON -ERROR@22688: expected command, found AS_KW -ERROR@22691: expected command, found IDENT -ERROR@22694: expected command, found COMMA -ERROR@22698: expected command, found CURRENT_TIME_KW -ERROR@22711: expected command, found L_PAREN -ERROR@22712: expected command, found INT_NUMBER -ERROR@22713: expected command, found R_PAREN -ERROR@22715: expected command, found AS_KW -ERROR@22718: expected command, found IDENT -ERROR@22721: expected command, found COMMA -ERROR@22757: expected SEMICOLON -ERROR@22758: expected command, found AS_KW -ERROR@22761: expected command, found IDENT -ERROR@22764: expected command, found COMMA -ERROR@22768: expected command, found CURRENT_TIMESTAMP_KW -ERROR@22786: expected command, found AS_KW -ERROR@22789: expected command, found IDENT -ERROR@22792: expected command, found COMMA -ERROR@22829: expected SEMICOLON -ERROR@22830: expected command, found AS_KW -ERROR@22833: expected command, found IDENT -ERROR@22836: expected command, found COMMA -ERROR@22840: expected command, found CURRENT_TIMESTAMP_KW -ERROR@22858: expected command, found L_PAREN -ERROR@22859: expected command, found INT_NUMBER -ERROR@22860: expected command, found R_PAREN -ERROR@22862: expected command, found AS_KW -ERROR@22865: expected command, found IDENT -ERROR@22868: expected command, found COMMA -ERROR@22909: expected SEMICOLON -ERROR@22910: expected command, found AS_KW -ERROR@22913: expected command, found IDENT -ERROR@22916: expected command, found COMMA -ERROR@22920: expected command, found LOCALTIME_KW -ERROR@22930: expected command, found AS_KW -ERROR@22933: expected command, found IDENT -ERROR@22936: expected command, found COMMA -ERROR@22965: expected SEMICOLON -ERROR@22966: expected command, found AS_KW -ERROR@22969: expected command, found IDENT -ERROR@22972: expected command, found COMMA -ERROR@22976: expected command, found LOCALTIME_KW -ERROR@22986: expected command, found L_PAREN -ERROR@22987: expected command, found INT_NUMBER -ERROR@22988: expected command, found R_PAREN -ERROR@22990: expected command, found AS_KW -ERROR@22993: expected command, found IDENT -ERROR@22996: expected command, found COMMA -ERROR@23029: expected SEMICOLON -ERROR@23030: expected command, found AS_KW -ERROR@23033: expected command, found IDENT -ERROR@23036: expected command, found COMMA -ERROR@23040: expected command, found LOCALTIMESTAMP_KW -ERROR@23055: expected command, found AS_KW -ERROR@23058: expected command, found IDENT -ERROR@23061: expected command, found COMMA -ERROR@23095: expected SEMICOLON -ERROR@23096: expected command, found AS_KW -ERROR@23099: expected command, found IDENT -ERROR@23102: expected command, found COMMA -ERROR@23106: expected command, found LOCALTIMESTAMP_KW -ERROR@23121: expected command, found L_PAREN -ERROR@23122: expected command, found INT_NUMBER -ERROR@23123: expected command, found R_PAREN -ERROR@23125: expected command, found AS_KW -ERROR@23128: expected command, found IDENT -ERROR@23131: expected command, found COMMA -ERROR@23169: expected SEMICOLON -ERROR@23170: expected command, found AS_KW -ERROR@23173: expected command, found IDENT -ERROR@23176: expected command, found COMMA -ERROR@23180: expected command, found CURRENT_CATALOG_KW -ERROR@23196: expected command, found AS_KW -ERROR@23199: expected command, found IDENT -ERROR@23201: expected command, found COMMA -ERROR@23236: expected SEMICOLON -ERROR@23237: expected command, found AS_KW -ERROR@23240: expected command, found IDENT -ERROR@23243: expected command, found COMMA -ERROR@23247: expected command, found CURRENT_ROLE_KW -ERROR@23260: expected command, found AS_KW -ERROR@23263: expected command, found IDENT -ERROR@23265: expected command, found COMMA -ERROR@23297: expected SEMICOLON -ERROR@23298: expected command, found AS_KW -ERROR@23301: expected command, found IDENT -ERROR@23304: expected command, found COMMA -ERROR@23308: expected command, found CURRENT_SCHEMA_KW -ERROR@23323: expected command, found AS_KW -ERROR@23326: expected command, found IDENT -ERROR@23328: expected command, found COMMA -ERROR@23362: expected SEMICOLON -ERROR@23363: expected command, found AS_KW -ERROR@23366: expected command, found IDENT -ERROR@23369: expected command, found COMMA -ERROR@23373: expected command, found CURRENT_USER_KW -ERROR@23386: expected command, found AS_KW -ERROR@23389: expected command, found IDENT -ERROR@23391: expected command, found COMMA -ERROR@23423: expected SEMICOLON -ERROR@23424: expected command, found AS_KW -ERROR@23427: expected command, found IDENT -ERROR@23430: expected command, found COMMA -ERROR@23434: expected command, found USER_KW -ERROR@23439: expected command, found AS_KW -ERROR@23442: expected command, found IDENT -ERROR@23444: expected command, found COMMA -ERROR@23468: expected SEMICOLON -ERROR@23469: expected command, found AS_KW -ERROR@23472: expected command, found IDENT -ERROR@23475: expected command, found COMMA -ERROR@23479: expected command, found SESSION_USER_KW -ERROR@23492: expected command, found IDENT -ERROR@23495: expected command, found COMMA -ERROR@23527: expected SEMICOLON -ERROR@23528: expected command, found AS_KW -ERROR@23531: expected command, found IDENT -ERROR@23535: expected command, found COMMA -ERROR@23539: expected command, found SYSTEM_USER_KW -ERROR@23551: expected command, found AS_KW -ERROR@23554: expected command, found IDENT -ERROR@23556: expected command, found COMMA -ERROR@23587: expected SEMICOLON -ERROR@23588: expected command, found AS_KW -ERROR@23591: expected command, found IDENT 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 36d6f935..cac3872a 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_partition_prune.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_partition_prune.snap @@ -230,7 +230,7 @@ ERROR@62378: expected MATCHED, or NOT MATCHED ERROR@62378: expected THEN_KW ERROR@62378: expected INSERT, UPDATE, DELETE, or DO NOTHING ERROR@62378: expected R_PAREN -ERROR@62378: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT +ERROR@62378: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: IDENT ERROR@62378: expected SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE, CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS ERROR@62378: expected SEMICOLON ERROR@62379: expected command, found IDENT @@ -283,7 +283,7 @@ ERROR@62673: expected MATCHED, or NOT MATCHED ERROR@62673: expected THEN_KW ERROR@62673: expected INSERT, UPDATE, DELETE, or DO NOTHING ERROR@62673: expected R_PAREN -ERROR@62673: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT +ERROR@62673: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: IDENT ERROR@62674: expected command, found IDENT ERROR@62685: expected command, found IDENT ERROR@62689: expected command, found ON_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap index 38f953b3..55bbae8e 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap @@ -9,7 +9,7 @@ ERROR@1253: expected L_PAREN ERROR@1254: expected command, found IDENT ERROR@1255: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@1255: expected R_PAREN -ERROR@1255: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@1255: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@1255: expected command, found L_PAREN ERROR@1256: expected command, found IDENT ERROR@1257: expected command, found COMMA @@ -30,7 +30,7 @@ ERROR@1392: expected L_PAREN ERROR@1393: expected command, found IDENT ERROR@1394: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@1394: expected R_PAREN -ERROR@1394: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@1394: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@1394: expected command, found L_PAREN ERROR@1395: expected command, found IDENT ERROR@1396: expected command, found COMMA @@ -55,7 +55,7 @@ ERROR@1926: expected L_PAREN ERROR@1927: expected command, found IDENT ERROR@1928: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@1928: expected R_PAREN -ERROR@1928: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@1928: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@1928: expected command, found L_PAREN ERROR@1929: expected command, found IDENT ERROR@1930: expected command, found COMMA @@ -84,7 +84,7 @@ ERROR@2786: expected L_PAREN ERROR@2787: expected command, found IDENT ERROR@2788: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@2788: expected R_PAREN -ERROR@2788: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@2788: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@2788: expected command, found L_PAREN ERROR@2789: expected command, found IDENT ERROR@2790: expected command, found COMMA @@ -99,7 +99,7 @@ ERROR@9794: expected L_PAREN ERROR@9795: expected command, found IDENT ERROR@9797: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@9797: expected R_PAREN -ERROR@9797: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@9797: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@9797: expected command, found L_PAREN ERROR@9798: expected command, found IDENT ERROR@9799: expected command, found COMMA @@ -148,7 +148,7 @@ ERROR@10205: expected L_PAREN ERROR@10206: expected command, found IDENT ERROR@10208: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@10208: expected R_PAREN -ERROR@10208: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@10208: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@10208: expected command, found L_PAREN ERROR@10209: expected command, found IDENT ERROR@10210: expected command, found COMMA @@ -197,7 +197,7 @@ ERROR@10495: expected L_PAREN ERROR@10496: expected command, found IDENT ERROR@10498: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@10498: expected R_PAREN -ERROR@10498: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@10498: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@10498: expected command, found L_PAREN ERROR@10499: expected command, found IDENT ERROR@10500: expected command, found COMMA @@ -224,7 +224,7 @@ ERROR@12684: expected L_PAREN ERROR@12685: expected command, found IDENT ERROR@12686: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@12686: expected R_PAREN -ERROR@12686: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@12686: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@12686: expected command, found L_PAREN ERROR@12687: expected command, found IDENT ERROR@12689: expected command, found COMMA @@ -274,7 +274,7 @@ ERROR@28763: expected L_PAREN ERROR@28763: expected command, found SEMICOLON ERROR@28764: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@28764: expected R_PAREN -ERROR@28764: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: CREATE_KW +ERROR@28764: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: CREATE_KW ERROR@28895: expected R_PAREN ERROR@28919: expected SEMICOLON ERROR@28919: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_returning.snap b/crates/squawk_parser/tests/snapshots/tests__regression_returning.snap index d55eff19..5b77fb1c 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_returning.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_returning.snap @@ -160,7 +160,7 @@ ERROR@10684: expected an expression in target_el, found OLD_KW ERROR@13248: expected an expression, found WITH_KW ERROR@13252: expected output expression ERROR@13252: expected R_PAREN -ERROR@13252: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN +ERROR@13252: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: L_PAREN ERROR@13253: expected command, found L_PAREN ERROR@13254: expected command, found OLD_KW ERROR@13258: expected command, found AS_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap index ed5dc08f..30e21456 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap @@ -28,7 +28,7 @@ ERROR@6176: expected L_PAREN ERROR@6177: expected command, found EQ ERROR@6178: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@6178: expected R_PAREN -ERROR@6178: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: INT_NUMBER +ERROR@6178: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: INT_NUMBER ERROR@6179: expected command, found INT_NUMBER ERROR@6181: expected command, found IDENT ERROR@6186: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_sqljson.snap b/crates/squawk_parser/tests/snapshots/tests__regression_sqljson.snap index 257ef8af..b2ad4487 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_sqljson.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_sqljson.snap @@ -6,11 +6,6 @@ ERROR@22: expected an expression, found R_PAREN ERROR@22: expected expression ERROR@1596: expected an expression, found R_PAREN ERROR@1596: expected expression -ERROR@8287: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@8287: expected R_PAREN -ERROR@8294: missing comma -ERROR@8301: expected SEMICOLON -ERROR@8301: expected command, found R_PAREN ERROR@8559: expected R_PAREN ERROR@8559: expected SEMICOLON ERROR@8560: expected command, found RETURNING_KW @@ -319,7 +314,7 @@ ERROR@10789: expected L_PAREN ERROR@10789: expected command, found UNIQUE_KW ERROR@10795: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@10795: expected R_PAREN -ERROR@10795: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@10795: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@10796: expected command, found KEYS_KW ERROR@10800: expected command, found R_PAREN ERROR@10802: expected command, found FROM_KW @@ -345,7 +340,7 @@ ERROR@10901: expected L_PAREN ERROR@10901: expected command, found UNIQUE_KW ERROR@10907: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@10907: expected R_PAREN -ERROR@10907: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@10907: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@10908: expected command, found KEYS_KW ERROR@10912: expected command, found R_PAREN ERROR@10914: expected command, found FROM_KW @@ -371,7 +366,7 @@ ERROR@11013: expected L_PAREN ERROR@11013: expected command, found UNIQUE_KW ERROR@11019: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@11019: expected R_PAREN -ERROR@11019: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@11019: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@11020: expected command, found KEYS_KW ERROR@11024: expected command, found R_PAREN ERROR@11026: expected command, found FROM_KW @@ -394,7 +389,7 @@ ERROR@11132: expected L_PAREN ERROR@11132: expected command, found UNIQUE_KW ERROR@11138: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@11138: expected R_PAREN -ERROR@11138: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@11138: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@11139: expected command, found KEYS_KW ERROR@11144: expected command, found RETURNING_KW ERROR@11154: expected command, found IDENT @@ -422,7 +417,7 @@ ERROR@11260: expected L_PAREN ERROR@11260: expected command, found UNIQUE_KW ERROR@11266: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@11266: expected R_PAREN -ERROR@11266: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@11266: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@11267: expected command, found KEYS_KW ERROR@11272: expected command, found RETURNING_KW ERROR@11282: expected command, found IDENT @@ -450,7 +445,7 @@ ERROR@11388: expected L_PAREN ERROR@11388: expected command, found UNIQUE_KW ERROR@11394: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@11394: expected R_PAREN -ERROR@11394: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@11394: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@11395: expected command, found KEYS_KW ERROR@11400: expected command, found RETURNING_KW ERROR@11410: expected command, found IDENT @@ -481,7 +476,7 @@ ERROR@11560: expected AS_KW ERROR@11560: expected L_PAREN ERROR@11560: expected command, found UNIQUE_KW ERROR@11566: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement -ERROR@11567: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: FROM_KW +ERROR@11567: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: FROM_KW ERROR@11568: expected command, found FROM_KW ERROR@11573: expected command, found IDENT ERROR@11588: expected command, found L_PAREN @@ -500,7 +495,7 @@ ERROR@11924: expected L_PAREN ERROR@11924: expected command, found UNIQUE_KW ERROR@11930: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@11930: expected R_PAREN -ERROR@11930: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@11930: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@11931: expected command, found KEYS_KW ERROR@11935: expected command, found R_PAREN ERROR@11937: expected command, found OVER_KW @@ -529,7 +524,7 @@ ERROR@12041: expected L_PAREN ERROR@12041: expected command, found UNIQUE_KW ERROR@12047: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@12047: expected R_PAREN -ERROR@12047: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@12047: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@12048: expected command, found KEYS_KW ERROR@12052: expected command, found R_PAREN ERROR@12054: expected command, found OVER_KW @@ -561,7 +556,7 @@ ERROR@12180: expected L_PAREN ERROR@12180: expected command, found UNIQUE_KW ERROR@12186: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@12186: expected R_PAREN -ERROR@12186: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@12186: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@12187: expected command, found KEYS_KW ERROR@12191: expected command, found R_PAREN ERROR@12196: expected command, found OVER_KW @@ -655,7 +650,7 @@ ERROR@12920: expected L_PAREN ERROR@12920: expected command, found UNIQUE_KW ERROR@12926: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@12926: expected R_PAREN -ERROR@12926: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: RETURNING_KW +ERROR@12926: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: RETURNING_KW ERROR@12927: expected command, found RETURNING_KW ERROR@12937: expected command, found TEXT_KW ERROR@12941: expected command, found R_PAREN @@ -694,7 +689,7 @@ ERROR@13085: expected L_PAREN ERROR@13085: expected command, found UNIQUE_KW ERROR@13091: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@13091: expected R_PAREN -ERROR@13091: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: RETURNING_KW +ERROR@13091: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: RETURNING_KW ERROR@13092: expected command, found RETURNING_KW ERROR@13102: expected command, found TEXT_KW ERROR@13106: expected command, found R_PAREN @@ -734,7 +729,7 @@ ERROR@13261: expected L_PAREN ERROR@13261: expected command, found UNIQUE_KW ERROR@13267: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@13267: expected R_PAREN -ERROR@13267: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: RETURNING_KW +ERROR@13267: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: RETURNING_KW ERROR@13268: expected command, found RETURNING_KW ERROR@13278: expected command, found TEXT_KW ERROR@13282: expected command, found R_PAREN @@ -844,7 +839,7 @@ ERROR@15123: expected L_PAREN ERROR@15123: expected command, found UNIQUE_KW ERROR@15129: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@15129: expected R_PAREN -ERROR@15129: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@15129: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@15130: expected command, found KEYS_KW ERROR@15135: expected command, found IDENT ERROR@15149: expected command, found FROM_KW @@ -864,7 +859,7 @@ ERROR@15427: expected L_PAREN ERROR@15427: expected command, found UNIQUE_KW ERROR@15433: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@15433: expected R_PAREN -ERROR@15433: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@15433: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@15434: expected command, found KEYS_KW ERROR@15439: expected command, found IDENT ERROR@15453: expected command, found FROM_KW @@ -888,7 +883,7 @@ ERROR@15780: expected L_PAREN ERROR@15780: expected command, found UNIQUE_KW ERROR@15786: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@15786: expected R_PAREN -ERROR@15786: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@15786: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@15787: expected command, found KEYS_KW ERROR@15792: expected command, found IDENT ERROR@15806: expected command, found FROM_KW @@ -914,7 +909,7 @@ ERROR@16142: expected L_PAREN ERROR@16142: expected command, found UNIQUE_KW ERROR@16148: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@16148: expected R_PAREN -ERROR@16148: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: KEYS_KW +ERROR@16148: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: KEYS_KW ERROR@16149: expected command, found KEYS_KW ERROR@16154: expected command, found IDENT ERROR@16168: expected command, found FROM_KW @@ -945,7 +940,7 @@ ERROR@16421: expected L_PAREN ERROR@16421: expected command, found UNIQUE_KW ERROR@16427: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@16427: expected R_PAREN -ERROR@16427: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: AS_KW +ERROR@16427: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: AS_KW ERROR@16428: expected command, found AS_KW ERROR@16431: expected command, found IDENT ERROR@16440: expected command, found FROM_KW @@ -978,7 +973,7 @@ ERROR@16627: expected L_PAREN ERROR@16627: expected command, found UNIQUE_KW ERROR@16633: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@16633: expected R_PAREN -ERROR@16633: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: AS_KW +ERROR@16633: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: AS_KW ERROR@16634: expected command, found AS_KW ERROR@16637: expected command, found IDENT ERROR@16646: expected command, found FROM_KW @@ -1030,7 +1025,7 @@ ERROR@17150: expected L_PAREN ERROR@17150: expected command, found UNIQUE_KW ERROR@17156: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@17156: expected R_PAREN -ERROR@17156: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: RETURNING_KW +ERROR@17156: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: RETURNING_KW ERROR@17157: expected command, found RETURNING_KW ERROR@17167: expected command, found VARCHAR_KW ERROR@17174: expected command, found L_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap b/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap index 911908e7..6c519674 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap @@ -20,26 +20,6 @@ ERROR@1508: missing comma ERROR@1545: expected column label, got BYTE_STRING ERROR@1550: missing comma ERROR@1646: missing comma -ERROR@3657: expected an expression, found FROM_KW -ERROR@3661: expected an expression -ERROR@3661: expected R_PAREN -ERROR@3661: missing comma -ERROR@3682: expected SEMICOLON -ERROR@3682: expected command, found R_PAREN -ERROR@3684: expected command, found EQ -ERROR@3686: expected command, found STRING -ERROR@3705: expected command, found AS_KW -ERROR@3708: expected command, found IDENT -ERROR@3750: expected an expression, found FROM_KW -ERROR@3754: expected an expression -ERROR@3754: expected R_PAREN -ERROR@3754: missing comma -ERROR@3775: expected SEMICOLON -ERROR@3775: expected command, found R_PAREN -ERROR@3777: expected command, found EQ -ERROR@3779: expected command, found STRING -ERROR@3798: expected command, found AS_KW -ERROR@3801: expected command, found IDENT ERROR@6298: missing comma ERROR@6354: missing comma ERROR@6606: missing comma @@ -163,29 +143,5 @@ ERROR@30094: expected command, found COMMA ERROR@30096: expected command, found STRING ERROR@30103: expected command, found AS_KW ERROR@30106: expected command, found IDENT -ERROR@31129: expected R_PAREN -ERROR@31134: expected from item, got ESC_STRING -ERROR@31134: expected SEMICOLON -ERROR@31135: expected command, found ESC_STRING -ERROR@31151: expected command, found COLON -ERROR@31152: expected command, found COLON -ERROR@31153: expected command, found IDENT -ERROR@31158: expected command, found R_PAREN -ERROR@31196: expected R_PAREN -ERROR@31201: expected from item, got ESC_STRING -ERROR@31201: expected SEMICOLON -ERROR@31202: expected command, found ESC_STRING -ERROR@31218: expected command, found COLON -ERROR@31219: expected command, found COLON -ERROR@31220: expected command, found IDENT -ERROR@31225: expected command, found R_PAREN -ERROR@31264: expected R_PAREN -ERROR@31269: expected from item, got ESC_STRING -ERROR@31269: expected SEMICOLON -ERROR@31270: expected command, found ESC_STRING -ERROR@31286: expected command, found COLON -ERROR@31287: expected command, found COLON -ERROR@31288: expected command, found IDENT -ERROR@31293: expected command, found R_PAREN ERROR@29864: unknown literal prefix ERROR@30010: unknown literal prefix diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap b/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap index 7c409628..bb0ccb44 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap @@ -5,9 +5,6 @@ input_file: crates/squawk_parser/tests/data/regression_suite/subselect.sql ERROR@31606: expected command, found L_PAREN ERROR@31607: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@31607: expected R_PAREN -ERROR@31607: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@31607: expected SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE, CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS -ERROR@31607: expected SEMICOLON ERROR@31626: expected SEMICOLON ERROR@31626: expected command, found R_PAREN ERROR@31631: expected command, found UNION_KW @@ -19,7 +16,6 @@ ERROR@31778: expected command, found R_PAREN ERROR@31824: expected command, found L_PAREN ERROR@31825: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@31825: expected R_PAREN -ERROR@31825: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW ERROR@31844: expected SEMICOLON ERROR@31844: expected command, found R_PAREN ERROR@31849: expected command, found UNION_KW @@ -31,9 +27,6 @@ ERROR@31996: expected command, found R_PAREN ERROR@32071: expected command, found L_PAREN ERROR@32072: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@32072: expected R_PAREN -ERROR@32072: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@32072: expected SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE, CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS -ERROR@32072: expected SEMICOLON ERROR@32091: expected SEMICOLON ERROR@32091: expected command, found R_PAREN ERROR@32096: expected command, found UNION_KW @@ -45,7 +38,6 @@ ERROR@32222: expected command, found R_PAREN ERROR@32268: expected command, found L_PAREN ERROR@32269: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@32269: expected R_PAREN -ERROR@32269: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW ERROR@32288: expected SEMICOLON ERROR@32288: expected command, found R_PAREN ERROR@32293: expected command, found UNION_KW 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 bd92c53a..c0617003 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap @@ -2,7 +2,6 @@ source: crates/squawk_parser/tests/tests.rs expression: "out.join(\"\\n\")" --- -tests/snapshots/tests__regression_create_view.snap:211 tests/snapshots/tests__regression_errors.snap:286 tests/snapshots/tests__regression_foreign_data.snap:51 tests/snapshots/tests__regression_foreign_key.snap:24 @@ -18,20 +17,20 @@ tests/snapshots/tests__regression_publication.snap:71 tests/snapshots/tests__regression_rangefuncs.snap:281 tests/snapshots/tests__regression_returning.snap:230 tests/snapshots/tests__regression_rules.snap:59 -tests/snapshots/tests__regression_sqljson.snap:1073 +tests/snapshots/tests__regression_sqljson.snap:1068 tests/snapshots/tests__regression_sqljson_jsontable.snap:185 tests/snapshots/tests__regression_sqljson_queryfuncs.snap:51 -tests/snapshots/tests__regression_strings.snap:187 -tests/snapshots/tests__regression_subselect.snap:52 +tests/snapshots/tests__regression_strings.snap:143 +tests/snapshots/tests__regression_subselect.snap:44 tests/snapshots/tests__regression_timestamp.snap:65 tests/snapshots/tests__regression_timestamptz.snap:5 tests/snapshots/tests__regression_transactions.snap:114 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_union.snap:25 +tests/snapshots/tests__regression_union.snap:15 tests/snapshots/tests__regression_update.snap:29 -tests/snapshots/tests__regression_vacuum.snap:21 +tests/snapshots/tests__regression_vacuum.snap:15 tests/snapshots/tests__regression_window.snap:72 -tests/snapshots/tests__regression_with.snap:27 +tests/snapshots/tests__regression_with.snap:9 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 f49f0fa7..25a07864 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_union.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_union.snap @@ -6,16 +6,6 @@ ERROR@996: expected SEMICOLON ERROR@997: expected command, found ORDER_KW ERROR@1003: expected command, found BY_KW ERROR@1006: expected command, found INT_NUMBER -ERROR@1841: expected an expression, found FROM_KW -ERROR@1845: expected an expression -ERROR@1845: expected R_PAREN -ERROR@1848: expected SEMICOLON -ERROR@1848: expected command, found R_PAREN -ERROR@1850: expected command, found FROM_KW -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@10339: expected SEMICOLON ERROR@10340: expected command, found ORDER_KW ERROR@10346: expected command, found BY_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_vacuum.snap b/crates/squawk_parser/tests/snapshots/tests__regression_vacuum.snap index bba117e2..1d7f9571 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_vacuum.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_vacuum.snap @@ -17,9 +17,3 @@ ERROR@11096: expected SEMICOLON ERROR@11097: expected command, found IDENT ERROR@11658: expected SEMICOLON ERROR@11659: expected command, found IDENT -ERROR@12293: expected R_PAREN -ERROR@12293: expected SEMICOLON -ERROR@12293: expected command, found MINUS -ERROR@12294: expected command, found IDENT -ERROR@12297: expected command, found R_PAREN -ERROR@12299: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_with.snap b/crates/squawk_parser/tests/snapshots/tests__regression_with.snap index 9750b82a..7a0ac0fe 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_with.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_with.snap @@ -5,27 +5,9 @@ input_file: crates/squawk_parser/tests/data/regression_suite/with.sql ERROR@23242: expected command, found L_PAREN ERROR@23243: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement ERROR@23243: expected R_PAREN -ERROR@23243: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: WITH_KW +ERROR@23243: expected DELETE, SELECT, TABLE, UPDATE, VALUES, or MERGE, got: WITH_KW ERROR@23288: expected SEMICOLON ERROR@23288: expected command, found R_PAREN ERROR@23292: expected command, found UNION_KW ERROR@23308: expected SEMICOLON ERROR@23308: expected command, found R_PAREN -ERROR@26584: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@26962: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@26962: expected R_PAREN -ERROR@26979: missing comma -ERROR@27002: expected SEMICOLON -ERROR@27003: expected command, found R_PAREN -ERROR@27005: expected command, found FROM_KW -ERROR@27010: expected command, found IDENT -ERROR@41836: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@42490: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@42612: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@42737: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@42859: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@43000: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: VALUES_KW -ERROR@43129: expected R_PAREN -ERROR@43133: expected L_PAREN -ERROR@43192: expected R_PAREN -ERROR@43196: expected L_PAREN