diff --git a/crates/squawk_lexer/src/lib.rs b/crates/squawk_lexer/src/lib.rs index 2de421f2..e61adf98 100644 --- a/crates/squawk_lexer/src/lib.rs +++ b/crates/squawk_lexer/src/lib.rs @@ -358,13 +358,13 @@ impl Cursor<'_> { fn double_quoted_string(&mut self) -> bool { while let Some(c) = self.bump() { match c { - '"' => { - return true; - } - '\\' if self.first() == '\\' || self.first() == '"' => { + '"' if self.first() == '"' => { // Bump again to skip escaped character. self.bump(); } + '"' => { + return true; + } _ => (), } } @@ -738,6 +738,13 @@ U&"d!0061t!+000061" UESCAPE '!' "hello-world +"#)) + } + + #[test] + fn quoted_ident_with_escape_quote() { + assert_debug_snapshot!(lex(r#" +"foo "" bar" "#)) } } diff --git a/crates/squawk_lexer/src/snapshots/squawk_lexer__tests__quoted_ident_with_escape_quote.snap b/crates/squawk_lexer/src/snapshots/squawk_lexer__tests__quoted_ident_with_escape_quote.snap new file mode 100644 index 00000000..c5dc32d1 --- /dev/null +++ b/crates/squawk_lexer/src/snapshots/squawk_lexer__tests__quoted_ident_with_escape_quote.snap @@ -0,0 +1,9 @@ +--- +source: crates/squawk_lexer/src/lib.rs +expression: "lex(r#\"\n\"foo \"\" bar\"\n\"#)" +--- +[ + "\n" @ Whitespace, + "\"foo \"\" bar\"" @ QuotedIdent { terminated: true }, + "\n" @ Whitespace, +] diff --git a/crates/squawk_parser/src/grammar.rs b/crates/squawk_parser/src/grammar.rs index b76fd8a3..1310287a 100644 --- a/crates/squawk_parser/src/grammar.rs +++ b/crates/squawk_parser/src/grammar.rs @@ -2239,32 +2239,7 @@ fn with_query(p: &mut Parser<'_>) -> Option { p.eat(MATERIALIZED_KW); } p.expect(L_PAREN); - match p.current() { - DELETE_KW => { - delete(p, None); - } - SELECT_KW | TABLE_KW | VALUES_KW => { - select(p, None); - } - INSERT_KW => { - insert(p, None); - } - UPDATE_KW => { - update(p, None); - } - MERGE_KW => { - merge(p, None); - } - WITH_KW => { - with(p, None); - } - _ => { - p.error(format!( - "expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: {:?}", - p.current() - )); - } - } + preparable_stmt(p); p.expect(R_PAREN); // [ SEARCH { BREADTH | DEPTH } FIRST BY column_name [, ...] SET search_seq_col_name ] if p.eat(SEARCH_KW) { @@ -9590,7 +9565,7 @@ fn drop_text_search_parser(p: &mut Parser<'_>) -> CompletedMarker { p.bump(SEARCH_KW); p.bump(PARSER_KW); opt_if_exists(p); - name_ref(p); + path_name_ref(p); opt_cascade_or_restrict(p); m.complete(p, DROP_TEXT_SEARCH_PARSER) } @@ -9609,7 +9584,7 @@ fn drop_text_search_config(p: &mut Parser<'_>) -> CompletedMarker { p.bump(SEARCH_KW); p.bump(CONFIGURATION_KW); opt_if_exists(p); - name_ref(p); + path_name_ref(p); opt_cascade_or_restrict(p); m.complete(p, DROP_TEXT_SEARCH_CONFIG) } @@ -9628,7 +9603,7 @@ fn drop_text_search_dict(p: &mut Parser<'_>) -> CompletedMarker { p.bump(SEARCH_KW); p.bump(DICTIONARY_KW); opt_if_exists(p); - name_ref(p); + path_name_ref(p); opt_cascade_or_restrict(p); m.complete(p, DROP_TEXT_SEARCH_DICT) } @@ -9644,7 +9619,7 @@ fn drop_text_search_template(p: &mut Parser<'_>) -> CompletedMarker { p.bump(SEARCH_KW); p.bump(TEMPLATE_KW); opt_if_exists(p); - name_ref(p); + path_name_ref(p); opt_cascade_or_restrict(p); m.complete(p, DROP_TEXT_SEARCH_TEMPLATE) } @@ -10855,27 +10830,7 @@ fn prepare(p: &mut Parser<'_>) -> CompletedMarker { p.expect(R_PAREN); } p.expect(AS_KW); - // statement - // Any SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement. - let statement = stmt( - p, - &StmtRestrictions { - begin_end_allowed: false, - }, - ); - if let Some(statement) = statement { - match statement.kind() { - SELECT | COMPOUND_SELECT | SELECT_INTO | VALUES | INSERT | UPDATE | DELETE | MERGE => {} - kind => { - p.error(format!( - "expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got {:?}", - kind - )); - } - } - } else { - p.error("expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement"); - } + preparable_stmt(p); m.complete(p, PREPARE) } @@ -11008,8 +10963,25 @@ fn declare(p: &mut Parser<'_>) -> CompletedMarker { p.expect(HOLD_KW); } p.expect(FOR_KW); - // select_stmt | values_stmt - query(p); + // select stmt + let statement = stmt( + p, + &StmtRestrictions { + begin_end_allowed: false, + }, + ); + match statement.map(|x| x.kind()) { + Some(SELECT | SELECT_INTO | COMPOUND_SELECT | TABLE | VALUES) => (), + Some(kind) => { + p.error(format!( + "expected SELECT, TABLE, or VALUES statement, got {:?}", + kind + )); + } + None => { + p.error("expected SELECT, TABLE, or VALUES statement"); + } + } m.complete(p, DECLARE) } @@ -11282,6 +11254,51 @@ fn copy_option_list(p: &mut Parser<'_>) { p.expect(R_PAREN); } +fn opt_copy_option_item(p: &mut Parser<'_>) -> bool { + match p.current() { + BINARY_KW | FREEZE_KW | CSV_KW | HEADER_KW => { + p.bump_any(); + } + DELIMITER_KW | NULL_KW | QUOTE_KW | ESCAPE_KW => { + p.bump_any(); + p.eat(AS_KW); + string_literal(p); + } + ENCODING_KW => { + p.bump_any(); + string_literal(p); + } + FORCE_KW => { + p.bump_any(); + match p.current() { + NOT_KW => { + p.bump_any(); + p.expect(NULL_KW); + if !p.eat(STAR) { + name_ref(p); + while !p.at(EOF) && p.eat(COMMA) { + name_ref(p); + } + } + } + QUOTE_KW | NULL_KW => { + p.bump_any(); + if !p.eat(STAR) { + name_ref(p); + while !p.at(EOF) && p.eat(COMMA) { + name_ref(p); + } + } + } + _ => return false, + } + } + + _ => return false, + } + true +} + // COPY table_name [ ( column_name [, ...] ) ] // FROM { 'filename' | PROGRAM 'command' | STDIN } // [ [ WITH ] ( option [, ...] ) ] @@ -11347,8 +11364,7 @@ fn copy(p: &mut Parser<'_>) -> CompletedMarker { let m = p.start(); p.bump(COPY_KW); if p.eat(L_PAREN) { - // query - query(p); + preparable_stmt(p); p.expect(R_PAREN); } else { // table_name @@ -11372,14 +11388,43 @@ fn copy(p: &mut Parser<'_>) -> CompletedMarker { string_literal(p); } } - // [ [ WITH ] ( option [, ...] ) ] - if p.eat(WITH_KW) || p.at(L_PAREN) { + p.eat(WITH_KW); + // [ ( option [, ...] ) ] + if p.at(L_PAREN) { copy_option_list(p); + } else { + // old copy option syntax + while !p.at(EOF) && opt_copy_option_item(p) {} } opt_where_clause(p); m.complete(p, COPY) } +fn preparable_stmt(p: &mut Parser<'_>) { + let statement = stmt( + p, + &StmtRestrictions { + begin_end_allowed: false, + }, + ); + match statement.map(|x| x.kind()) { + // select | insert | update | delete | merge + Some( + SELECT | SELECT_INTO | COMPOUND_SELECT | TABLE | VALUES | INSERT | UPDATE | DELETE + | MERGE, + ) => (), + Some(kind) => { + p.error(format!( + "expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement, got {:?}", + kind + )); + } + None => { + p.error("expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement"); + } + } +} + // https://www.postgresql.org/docs/17/sql-call.html // CALL name ( [ argument ] [, ...] ) fn call(p: &mut Parser<'_>) -> CompletedMarker { diff --git a/crates/squawk_parser/tests/data/regression_suite/copy.sql b/crates/squawk_parser/tests/data/regression_suite/copy.sql index 818f0102..154d51fd 100644 --- a/crates/squawk_parser/tests/data/regression_suite/copy.sql +++ b/crates/squawk_parser/tests/data/regression_suite/copy.sql @@ -45,14 +45,14 @@ select test from copytest2 order by test collate "C"; -- in text mode, \. must be alone on its line truncate copytest2; copy copytest2(test) from stdin; -line1 -line2 -foo\. -line3 +-- line1 +-- line2 +-- foo\. +-- line3 copy copytest2(test) from stdin; -line4 -line5 -line6 +-- line4 +-- line5 +-- line6 select test from copytest2; @@ -64,9 +64,9 @@ create temp table copytest3 ( "col with "" quote" int); copy copytest3 from stdin csv header; -this is just a line full of junk that would error out if parsed -1,a,1 -2,b,2 +-- this is just a line full of junk that would error out if parsed +-- 1,a,1 +-- 2,b,2 copy copytest3 to stdout csv header; @@ -75,9 +75,9 @@ create temp table copytest4 ( "colname with tab: " text); copy copytest4 from stdin (header); -this is just a line full of junk that would error out if parsed -1 a -2 b +-- this is just a line full of junk that would error out if parsed +-- 1 a +-- 2 b copy copytest4 to stdout (header); @@ -139,8 +139,8 @@ create index on parted_copytest (b); drop trigger part_ins_trig on parted_copytest_a2; copy parted_copytest from stdin; -1 1 str1 -2 2 str2 +-- 1 1 str1 +-- 2 2 str2 -- Ensure index entries were properly added during the copy. select * from parted_copytest where b = 1; @@ -197,9 +197,9 @@ create trigger check_after_tab_progress_reporting -- Generate COPY FROM report with PIPE. copy tab_progress_reporting from stdin; -sharon 25 (15,12) 1000 sam -sam 30 (10,5) 2000 bill -bill 20 (11,10) 1000 sharon +-- sharon 25 (15,12) 1000 sam +-- sam 30 (10,5) 2000 bill +-- bill 20 (11,10) 1000 sharon -- Generate COPY FROM report with FILE, with some excluded tuples. truncate tab_progress_reporting; @@ -208,9 +208,9 @@ copy tab_progress_reporting from 'filename' -- Generate COPY FROM report with PIPE, with some skipped tuples. copy tab_progress_reporting from stdin(on_error ignore); -sharon x (15,12) x sam -sharon 25 (15,12) 1000 sam -sharon y (15,12) x sam +-- sharon x (15,12) x sam +-- sharon 25 (15,12) 1000 sam +-- sharon y (15,12) x sam drop trigger check_after_tab_progress_reporting on tab_progress_reporting; drop function notice_after_tab_progress_reporting(); @@ -229,48 +229,48 @@ copy header_copytest to stdout with (header match); copy header_copytest from stdin with (header wrong_choice); -- works copy header_copytest from stdin with (header match); -a b c -1 2 foo +-- a b c +-- 1 2 foo copy header_copytest (c, a, b) from stdin with (header match); -c a b -bar 3 4 +-- c a b +-- bar 3 4 copy header_copytest from stdin with (header match, format csv); -a,b,c -5,6,baz +-- a,b,c +-- 5,6,baz -- errors copy header_copytest (c, b, a) from stdin with (header match); -a b c -1 2 foo +-- a b c +-- 1 2 foo copy header_copytest from stdin with (header match); -a b \N -1 2 foo +-- a b \N +-- 1 2 foo copy header_copytest from stdin with (header match); -a b -1 2 +-- a b +-- 1 2 copy header_copytest from stdin with (header match); -a b c d -1 2 foo bar +-- a b c d +-- 1 2 foo bar copy header_copytest from stdin with (header match); -a b d -1 2 foo +-- a b d +-- 1 2 foo SELECT * FROM header_copytest ORDER BY a; -- Drop an extra column, in the middle of the existing set. alter table header_copytest drop column b; -- works copy header_copytest (c, a) from stdin with (header match); -c a -foo 7 +-- c a +-- foo 7 copy header_copytest (a, c) from stdin with (header match); -a c -8 foo +-- a c +-- 8 foo -- errors copy header_copytest from stdin with (header match); -a ........pg.dropped.2........ c -1 2 foo +-- a ........pg.dropped.2........ c +-- 1 2 foo copy header_copytest (a, c) from stdin with (header match); -a c b -1 foo 2 +-- a c b +-- 1 foo 2 SELECT * FROM header_copytest ORDER BY a; drop table header_copytest; @@ -329,7 +329,7 @@ create foreign data wrapper copytest_wrapper; create server copytest_server foreign data wrapper copytest_wrapper; create foreign table copytest_foreign_table (a int) server copytest_server; copy copytest_foreign_table from stdin (freeze); -1 +-- 1 rollback; -- Tests for COPY TO with materialized views. diff --git a/crates/squawk_parser/tests/data/regression_suite/copy2.sql b/crates/squawk_parser/tests/data/regression_suite/copy2.sql index 67598da4..256d7de3 100644 --- a/crates/squawk_parser/tests/data/regression_suite/copy2.sql +++ b/crates/squawk_parser/tests/data/regression_suite/copy2.sql @@ -80,13 +80,13 @@ COPY y TO stdout (FORMAT CSV, FORCE_QUOTE *); CREATE TEMP TABLE testnl (a int, b text, c int); -inside",2 +-- inside",2 -- test end of copy marker CREATE TEMP TABLE testeoc (a text); -c\.d -"\." +-- c\.d +-- "\." COPY testeoc TO stdout CSV; @@ -195,9 +195,9 @@ begin end $$ language plpgsql immutable; alter table check_con_tbl add check (check_con_function(check_con_tbl.*)); copy check_con_tbl from stdin; -1 +-- 1 copy check_con_tbl from stdin; -0 +-- 0 select * from check_con_tbl; -- test with RLS enabled. @@ -287,14 +287,14 @@ COMMIT; -- tests for on_error option CREATE TABLE check_ign_err (n int, m int[], k int); -5 {5} 5 +-- 5 {5} 5 --- want context for notices +-- -- want context for notices -5 {5} 5 -6 a -7 {7} a -8 {8} 8 +-- 5 {5} 5 +-- 6 a +-- 7 {7} a +-- 8 {8} 8 -- tests for on_error option with log_verbosity and null constraint via domain CREATE DOMAIN dcheck_ign_err2 varchar(15) NOT NULL; @@ -314,9 +314,9 @@ CREATE TABLE hard_err(foo widget); -- test extra data: should fail -- tests for reject_limit option -10 {10} 10 +-- 10 {10} 10 -10 {10} 10 +-- 10 {10} 10 -- clean up DROP TABLE forcetest; @@ -349,16 +349,16 @@ create temp table copy_default ( -- if DEFAULT is not specified, then the marker will be regular data copy copy_default from stdin; -1 value '2022-07-04' -2 \D '2022-07-05' +-- 1 value '2022-07-04' +-- 2 \D '2022-07-05' select id, text_value, ts_value from copy_default; truncate copy_default; copy copy_default from stdin with (format csv); -1,value,2022-07-04 -2,\D,2022-07-05 +-- 1,value,2022-07-04 +-- 2,\D,2022-07-05 select id, text_value, ts_value from copy_default; @@ -382,25 +382,25 @@ copy copy_default from stdin with (default '\N'); -- cannot use DEFAULT marker in column that has no DEFAULT value copy copy_default from stdin with (default '\D'); -2 \D '2022-07-05' +-- 2 \D '2022-07-05' copy copy_default from stdin with (format csv, default '\D'); -2,\D,2022-07-05 +-- 2,\D,2022-07-05 -- The DEFAULT marker must be unquoted and unescaped or it's not recognized copy copy_default from stdin with (default '\D'); -1 \D '2022-07-04' -2 \\D '2022-07-04' -3 "\D" '2022-07-04' +-- 1 \D '2022-07-04' +-- 2 \\D '2022-07-04' +-- 3 "\D" '2022-07-04' select id, text_value, ts_value from copy_default; truncate copy_default; copy copy_default from stdin with (format csv, default '\D'); -1,\D,2022-07-04 -2,\\D,2022-07-04 -3,"\D",2022-07-04 +-- 1,\D,2022-07-04 +-- 2,\\D,2022-07-04 +-- 3,"\D",2022-07-04 select id, text_value, ts_value from copy_default; @@ -408,18 +408,18 @@ truncate copy_default; -- successful usage of DEFAULT option in COPY copy copy_default from stdin with (default '\D'); -1 value '2022-07-04' -2 \D '2022-07-03' -3 \D \D +-- 1 value '2022-07-04' +-- 2 \D '2022-07-03' +-- 3 \D \D select id, text_value, ts_value from copy_default; truncate copy_default; copy copy_default from stdin with (format csv, default '\D'); -1,value,2022-07-04 -2,\D,2022-07-03 -3,\D,\D +-- 1,value,2022-07-04 +-- 2,\D,2022-07-03 +-- 3,\D,\D select id, text_value, ts_value from copy_default; diff --git a/crates/squawk_parser/tests/data/regression_suite/create_am.sql b/crates/squawk_parser/tests/data/regression_suite/create_am.sql index 754fe0c6..63b8e19a 100644 --- a/crates/squawk_parser/tests/data/regression_suite/create_am.sql +++ b/crates/squawk_parser/tests/data/regression_suite/create_am.sql @@ -112,13 +112,13 @@ CREATE TABLE tableam_tblas_heap2 USING heap2 AS SELECT * FROM tableam_tbl_heap2; SELECT f1 FROM tableam_tbl_heap2 ORDER BY f1; -- SELECT INTO doesn't support USING -SELECT INTO tableam_tblselectinto_heap2 USING heap2 FROM tableam_tbl_heap2; +-- SELECT INTO tableam_tblselectinto_heap2 USING heap2 FROM tableam_tbl_heap2; -- CREATE VIEW doesn't support USING -CREATE VIEW tableam_view_heap2 USING heap2 AS SELECT * FROM tableam_tbl_heap2; +-- CREATE VIEW tableam_view_heap2 USING heap2 AS SELECT * FROM tableam_tbl_heap2; -- CREATE SEQUENCE doesn't support USING -CREATE SEQUENCE tableam_seq_heap2 USING heap2; +-- CREATE SEQUENCE tableam_seq_heap2 USING heap2; -- CREATE MATERIALIZED VIEW does support USING CREATE MATERIALIZED VIEW tableam_tblmv_heap2 USING heap2 AS SELECT * FROM tableam_tbl_heap2; diff --git a/crates/squawk_parser/tests/data/regression_suite/stats.sql b/crates/squawk_parser/tests/data/regression_suite/stats.sql index 9942ffc2..a0bc2e60 100644 --- a/crates/squawk_parser/tests/data/regression_suite/stats.sql +++ b/crates/squawk_parser/tests/data/regression_suite/stats.sql @@ -662,7 +662,7 @@ SELECT current_setting('fsync') = 'off' OR 'my_io_sum_shared_after_fsyncs' >= 'my_io_sum_shared_before_fsyncs'; SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs FROM pg_stat_io - WHERE context = 'normal' AND object = 'wal' ; io_sum_wal_normal_after_ + WHERE context = 'normal' AND object = 'wal' ; -- io_sum_wal_normal_after_ SELECT current_setting('synchronous_commit') = 'on'; SELECT 'io_sum_wal_normal_after_writes' > 'io_sum_wal_normal_before_writes'; SELECT current_setting('fsync') = 'off' diff --git a/crates/squawk_parser/tests/data/regression_suite/subscription.sql b/crates/squawk_parser/tests/data/regression_suite/subscription.sql index f7283aa5..e5706c1c 100644 --- a/crates/squawk_parser/tests/data/regression_suite/subscription.sql +++ b/crates/squawk_parser/tests/data/regression_suite/subscription.sql @@ -9,10 +9,10 @@ CREATE ROLE regress_subscription_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_subscription_user'; -- fail - no publications -CREATE SUBSCRIPTION regress_testsub CONNECTION 'foo'; +-- CREATE SUBSCRIPTION regress_testsub CONNECTION 'foo'; -- fail - no connection -CREATE SUBSCRIPTION regress_testsub PUBLICATION foo; +-- CREATE SUBSCRIPTION regress_testsub PUBLICATION foo; -- fail - cannot do CREATE SUBSCRIPTION CREATE SLOT inside transaction block BEGIN; diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_config_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_config_ok.snap index da31d32f..0dee557e 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_config_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_config_ok.snap @@ -14,8 +14,10 @@ SOURCE_FILE WHITESPACE " " CONFIGURATION_KW "configuration" WHITESPACE " " - NAME_REF - IDENT "foo" + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- full" @@ -34,8 +36,10 @@ SOURCE_FILE WHITESPACE " " EXISTS_KW "exists" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " CASCADE_KW "cascade" SEMICOLON ";" @@ -51,8 +55,10 @@ SOURCE_FILE WHITESPACE " " CONFIGURATION_KW "configuration" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " RESTRICT_KW "restrict" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_dict_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_dict_ok.snap index a85786ad..a64370d8 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_dict_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_dict_ok.snap @@ -14,8 +14,10 @@ SOURCE_FILE WHITESPACE " " DICTIONARY_KW "dictionary" WHITESPACE " " - NAME_REF - IDENT "foo" + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- full" @@ -34,8 +36,10 @@ SOURCE_FILE WHITESPACE " " EXISTS_KW "exists" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " CASCADE_KW "cascade" SEMICOLON ";" @@ -51,8 +55,10 @@ SOURCE_FILE WHITESPACE " " DICTIONARY_KW "dictionary" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " RESTRICT_KW "restrict" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_parser_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_parser_ok.snap index 2de57d9b..6a5540cb 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_parser_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_parser_ok.snap @@ -14,8 +14,10 @@ SOURCE_FILE WHITESPACE " " PARSER_KW "parser" WHITESPACE " " - NAME_REF - IDENT "foo" + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- full" @@ -34,8 +36,10 @@ SOURCE_FILE WHITESPACE " " EXISTS_KW "exists" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " CASCADE_KW "cascade" SEMICOLON ";" @@ -51,8 +55,10 @@ SOURCE_FILE WHITESPACE " " PARSER_KW "parser" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " RESTRICT_KW "restrict" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_template_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_template_ok.snap index 0c237fb8..85ca08a4 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_text_search_template_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_text_search_template_ok.snap @@ -14,8 +14,10 @@ SOURCE_FILE WHITESPACE " " TEMPLATE_KW "template" WHITESPACE " " - NAME_REF - IDENT "foo" + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- full" @@ -34,8 +36,10 @@ SOURCE_FILE WHITESPACE " " EXISTS_KW "exists" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " CASCADE_KW "cascade" SEMICOLON ";" @@ -51,8 +55,10 @@ SOURCE_FILE WHITESPACE " " TEMPLATE_KW "template" WHITESPACE " " - NAME_REF - IDENT "bar" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" WHITESPACE " " RESTRICT_KW "restrict" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_copy.snap b/crates/squawk_parser/tests/snapshots/tests__regression_copy.snap deleted file mode 100644 index 80306516..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_copy.snap +++ /dev/null @@ -1,235 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/copy.sql ---- -ERROR@481: expected SEMICOLON -ERROR@482: expected command, found CSV_KW -ERROR@564: expected SEMICOLON -ERROR@565: expected command, found CSV_KW -ERROR@740: expected SEMICOLON -ERROR@741: expected command, found CSV_KW -ERROR@745: expected command, found QUOTE_KW -ERROR@751: expected command, found STRING -ERROR@756: expected command, found ESCAPE_KW -ERROR@763: expected command, found ESC_STRING -ERROR@801: expected SEMICOLON -ERROR@802: expected command, found CSV_KW -ERROR@806: expected command, found QUOTE_KW -ERROR@812: expected command, found STRING -ERROR@817: expected command, found ESCAPE_KW -ERROR@824: expected command, found ESC_STRING -ERROR@1082: expected SEMICOLON -ERROR@1083: expected command, found CSV_KW -ERROR@1242: expected command, found IDENT -ERROR@1248: expected command, found IDENT -ERROR@1254: expected command, found IDENT -ERROR@1257: expected command, found ERROR -ERROR@1258: expected command, found DOT -ERROR@1260: expected command, found IDENT -ERROR@1299: expected command, found IDENT -ERROR@1305: expected command, found IDENT -ERROR@1311: expected command, found IDENT -ERROR@1461: expected R_PAREN -ERROR@1461: expected SEMICOLON -ERROR@1463: expected command, found INT_KW -ERROR@1466: expected command, found R_PAREN -ERROR@1495: expected SEMICOLON -ERROR@1496: expected command, found CSV_KW -ERROR@1500: expected command, found HEADER_KW -ERROR@1508: expected command, found IDENT -ERROR@1513: expected command, found IS_KW -ERROR@1516: expected command, found IDENT -ERROR@1521: expected command, found IDENT -ERROR@1523: expected command, found IDENT -ERROR@1528: expected command, found FULL_KW -ERROR@1533: expected command, found OF_KW -ERROR@1536: expected command, found IDENT -ERROR@1541: expected command, found IDENT -ERROR@1546: expected command, found IDENT -ERROR@1552: expected command, found ERROR_KW -ERROR@1558: expected command, found OUT_KW -ERROR@1562: expected command, found IF_KW -ERROR@1565: expected command, found IDENT -ERROR@1572: expected command, found INT_NUMBER -ERROR@1573: expected command, found COMMA -ERROR@1574: expected command, found IDENT -ERROR@1575: expected command, found COMMA -ERROR@1576: expected command, found INT_NUMBER -ERROR@1578: expected command, found INT_NUMBER -ERROR@1579: expected command, found COMMA -ERROR@1580: expected command, found IDENT -ERROR@1581: expected command, found COMMA -ERROR@1582: expected command, found INT_NUMBER -ERROR@1609: expected SEMICOLON -ERROR@1610: expected command, found CSV_KW -ERROR@1614: expected command, found HEADER_KW -ERROR@1729: expected command, found IDENT -ERROR@1734: expected command, found IS_KW -ERROR@1737: expected command, found IDENT -ERROR@1742: expected command, found IDENT -ERROR@1744: expected command, found IDENT -ERROR@1749: expected command, found FULL_KW -ERROR@1754: expected command, found OF_KW -ERROR@1757: expected command, found IDENT -ERROR@1762: expected command, found IDENT -ERROR@1767: expected command, found IDENT -ERROR@1773: expected command, found ERROR_KW -ERROR@1779: expected command, found OUT_KW -ERROR@1783: expected command, found IF_KW -ERROR@1786: expected command, found IDENT -ERROR@1793: expected command, found INT_NUMBER -ERROR@1795: expected command, found IDENT -ERROR@1797: expected command, found INT_NUMBER -ERROR@1799: expected command, found IDENT -ERROR@3620: expected command, found INT_NUMBER -ERROR@3622: expected command, found INT_NUMBER -ERROR@3624: expected command, found IDENT -ERROR@3629: expected command, found INT_NUMBER -ERROR@3631: expected command, found INT_NUMBER -ERROR@3633: expected command, found IDENT -ERROR@5245: expected command, found IDENT -ERROR@5252: expected command, found INT_NUMBER -ERROR@5255: expected command, found L_PAREN -ERROR@5256: expected command, found INT_NUMBER -ERROR@5258: expected command, found COMMA -ERROR@5259: expected command, found INT_NUMBER -ERROR@5261: expected command, found R_PAREN -ERROR@5263: expected command, found INT_NUMBER -ERROR@5268: expected command, found IDENT -ERROR@5272: expected command, found IDENT -ERROR@5276: expected command, found INT_NUMBER -ERROR@5279: expected command, found L_PAREN -ERROR@5280: expected command, found INT_NUMBER -ERROR@5282: expected command, found COMMA -ERROR@5283: expected command, found INT_NUMBER -ERROR@5284: expected command, found R_PAREN -ERROR@5286: expected command, found INT_NUMBER -ERROR@5291: expected command, found IDENT -ERROR@5296: expected command, found IDENT -ERROR@5301: expected command, found INT_NUMBER -ERROR@5304: expected command, found L_PAREN -ERROR@5305: expected command, found INT_NUMBER -ERROR@5307: expected command, found COMMA -ERROR@5308: expected command, found INT_NUMBER -ERROR@5310: expected command, found R_PAREN -ERROR@5312: expected command, found INT_NUMBER -ERROR@5317: expected command, found IDENT -ERROR@5617: expected command, found IDENT -ERROR@5624: expected command, found IDENT -ERROR@5626: expected command, found L_PAREN -ERROR@5627: expected command, found INT_NUMBER -ERROR@5629: expected command, found COMMA -ERROR@5630: expected command, found INT_NUMBER -ERROR@5632: expected command, found R_PAREN -ERROR@5634: expected command, found IDENT -ERROR@5636: expected command, found IDENT -ERROR@5640: expected command, found IDENT -ERROR@5647: expected command, found INT_NUMBER -ERROR@5650: expected command, found L_PAREN -ERROR@5651: expected command, found INT_NUMBER -ERROR@5653: expected command, found COMMA -ERROR@5654: expected command, found INT_NUMBER -ERROR@5656: expected command, found R_PAREN -ERROR@5658: expected command, found INT_NUMBER -ERROR@5663: expected command, found IDENT -ERROR@5667: expected command, found IDENT -ERROR@5674: expected command, found IDENT -ERROR@5676: expected command, found L_PAREN -ERROR@5677: expected command, found INT_NUMBER -ERROR@5679: expected command, found COMMA -ERROR@5680: expected command, found INT_NUMBER -ERROR@5682: expected command, found R_PAREN -ERROR@5684: expected command, found IDENT -ERROR@5686: expected command, found IDENT -ERROR@6252: expected command, found IDENT -ERROR@6254: expected command, found IDENT -ERROR@6256: expected command, found IDENT -ERROR@6258: expected command, found INT_NUMBER -ERROR@6260: expected command, found INT_NUMBER -ERROR@6262: expected command, found IDENT -ERROR@6329: expected command, found IDENT -ERROR@6331: expected command, found IDENT -ERROR@6333: expected command, found IDENT -ERROR@6335: expected command, found IDENT -ERROR@6339: expected command, found INT_NUMBER -ERROR@6341: expected command, found INT_NUMBER -ERROR@6408: expected command, found IDENT -ERROR@6409: expected command, found COMMA -ERROR@6410: expected command, found IDENT -ERROR@6411: expected command, found COMMA -ERROR@6412: expected command, found IDENT -ERROR@6414: expected command, found INT_NUMBER -ERROR@6415: expected command, found COMMA -ERROR@6416: expected command, found INT_NUMBER -ERROR@6417: expected command, found COMMA -ERROR@6418: expected command, found IDENT -ERROR@6495: expected command, found IDENT -ERROR@6497: expected command, found IDENT -ERROR@6499: expected command, found IDENT -ERROR@6501: expected command, found INT_NUMBER -ERROR@6503: expected command, found INT_NUMBER -ERROR@6505: expected command, found IDENT -ERROR@6562: expected command, found IDENT -ERROR@6564: expected command, found IDENT -ERROR@6566: expected command, found ERROR -ERROR@6567: expected command, found IDENT -ERROR@6569: expected command, found INT_NUMBER -ERROR@6571: expected command, found INT_NUMBER -ERROR@6573: expected command, found IDENT -ERROR@6630: expected command, found IDENT -ERROR@6632: expected command, found IDENT -ERROR@6634: expected command, found INT_NUMBER -ERROR@6636: expected command, found INT_NUMBER -ERROR@6691: expected command, found IDENT -ERROR@6693: expected command, found IDENT -ERROR@6695: expected command, found IDENT -ERROR@6697: expected command, found IDENT -ERROR@6699: expected command, found INT_NUMBER -ERROR@6701: expected command, found INT_NUMBER -ERROR@6703: expected command, found IDENT -ERROR@6707: expected command, found IDENT -ERROR@6764: expected command, found IDENT -ERROR@6766: expected command, found IDENT -ERROR@6768: expected command, found IDENT -ERROR@6770: expected command, found INT_NUMBER -ERROR@6772: expected command, found INT_NUMBER -ERROR@6774: expected command, found IDENT -ERROR@6993: expected command, found IDENT -ERROR@6995: expected command, found IDENT -ERROR@6997: expected command, found IDENT -ERROR@7001: expected command, found INT_NUMBER -ERROR@7063: expected command, found IDENT -ERROR@7065: expected command, found IDENT -ERROR@7067: expected command, found INT_NUMBER -ERROR@7069: expected command, found IDENT -ERROR@7136: expected command, found IDENT -ERROR@7138: expected command, found DOT -ERROR@7139: expected command, found DOT -ERROR@7140: expected command, found DOT -ERROR@7141: expected command, found DOT -ERROR@7142: expected command, found DOT -ERROR@7143: expected command, found DOT -ERROR@7144: expected command, found DOT -ERROR@7145: expected command, found DOT -ERROR@7146: expected command, found IDENT -ERROR@7148: expected command, found DOT -ERROR@7149: expected command, found IDENT -ERROR@7156: expected command, found FLOAT_NUMBER -ERROR@7159: expected command, found DOT -ERROR@7160: expected command, found DOT -ERROR@7161: expected command, found DOT -ERROR@7162: expected command, found DOT -ERROR@7163: expected command, found DOT -ERROR@7164: expected command, found DOT -ERROR@7165: expected command, found DOT -ERROR@7167: expected command, found IDENT -ERROR@7169: expected command, found INT_NUMBER -ERROR@7171: expected command, found INT_NUMBER -ERROR@7173: expected command, found IDENT -ERROR@7237: expected command, found IDENT -ERROR@7239: expected command, found IDENT -ERROR@7241: expected command, found IDENT -ERROR@7243: expected command, found INT_NUMBER -ERROR@7245: expected command, found IDENT -ERROR@7249: expected command, found INT_NUMBER -ERROR@9642: expected command, found INT_NUMBER diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_copy2.snap b/crates/squawk_parser/tests/snapshots/tests__regression_copy2.snap deleted file mode 100644 index b5b476b4..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_copy2.snap +++ /dev/null @@ -1,62 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/copy2.sql ---- -ERROR@1026: expected L_PAREN -ERROR@1043: expected R_PAREN -ERROR@1246: expected L_PAREN -ERROR@1250: expected R_PAREN -ERROR@1273: expected L_PAREN -ERROR@1283: expected R_PAREN -ERROR@1283: expected SEMICOLON -ERROR@1284: expected command, found STRING -ERROR@1289: expected command, found DELIMITER_KW -ERROR@1299: expected command, found STRING -ERROR@1325: expected L_PAREN -ERROR@1335: expected R_PAREN -ERROR@1335: expected SEMICOLON -ERROR@1336: expected command, found QUOTE_KW -ERROR@1342: expected command, found IDENT -ERROR@1347: expected command, found ESCAPE_KW -ERROR@1354: expected command, found ESC_STRING -ERROR@1360: expected command, found ENCODING_KW -ERROR@1369: expected command, found STRING -ERROR@1403: expected L_PAREN -ERROR@1413: expected R_PAREN -ERROR@1413: expected SEMICOLON -ERROR@1414: expected command, found QUOTE_KW -ERROR@1420: expected command, found STAR -ERROR@1772: expected command, found IDENT -ERROR@1778: expected command, found IDENT -ERROR@1853: expected command, found ERROR -ERROR@1854: expected command, found DOT -ERROR@1855: expected command, found IDENT -ERROR@3206: expected command, found IDENT -ERROR@3207: expected command, found IDENT -ERROR@3235: expected command, found IDENT -ERROR@3236: expected command, found IDENT -ERROR@3521: expected command, found NOT_KW -ERROR@3525: expected command, found IDENT -ERROR@3536: expected command, found BY_KW -ERROR@3638: expected SEMICOLON -ERROR@3638: expected command, found IDENT -ERROR@3639: expected command, found IDENT -ERROR@3753: expected command, found IDENT -ERROR@3754: expected command, found IDENT -ERROR@3846: expected command, found IDENT -ERROR@3858: expected command, found OR_KW -ERROR@3861: expected command, found IDENT -ERROR@3871: expected command, found OPTIONS_KW -ERROR@3878: expected command, found IDENT -ERROR@8835: expected command, found STRING -ERROR@8847: expected command, found IDENT -ERROR@8851: expected command, found IDENT -ERROR@9334: expected command, found ERROR -ERROR@9335: expected command, found IDENT -ERROR@9336: expected command, found IDENT -ERROR@9526: expected command, found ERROR -ERROR@9527: expected command, found IDENT -ERROR@9528: expected command, found IDENT -ERROR@3206: unknown literal prefix -ERROR@3638: unknown literal prefix -ERROR@9528: Missing trailing " to terminate the quoted identifier diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_copydml.snap b/crates/squawk_parser/tests/snapshots/tests__regression_copydml.snap deleted file mode 100644 index 6cfb4ad9..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_copydml.snap +++ /dev/null @@ -1,158 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/copydml.sql ---- -ERROR@370: expected select stmt -ERROR@370: expected R_PAREN -ERROR@370: expected SEMICOLON -ERROR@424: expected SEMICOLON -ERROR@424: expected command, found R_PAREN -ERROR@426: expected command, found TO_KW -ERROR@429: expected command, found STDOUT_KW -ERROR@443: expected select stmt -ERROR@443: expected R_PAREN -ERROR@443: expected SEMICOLON -ERROR@501: expected SEMICOLON -ERROR@501: expected command, found R_PAREN -ERROR@503: expected command, found TO_KW -ERROR@506: expected command, found STDOUT_KW -ERROR@520: expected select stmt -ERROR@520: expected R_PAREN -ERROR@520: expected SEMICOLON -ERROR@571: expected SEMICOLON -ERROR@571: expected command, found R_PAREN -ERROR@573: expected command, found TO_KW -ERROR@576: expected command, found STDOUT_KW -ERROR@654: expected select stmt -ERROR@654: expected R_PAREN -ERROR@654: expected SEMICOLON -ERROR@693: expected SEMICOLON -ERROR@693: expected command, found R_PAREN -ERROR@695: expected command, found TO_KW -ERROR@698: expected command, found STDOUT_KW -ERROR@712: expected select stmt -ERROR@712: expected R_PAREN -ERROR@712: expected SEMICOLON -ERROR@743: expected SEMICOLON -ERROR@743: expected command, found R_PAREN -ERROR@745: expected command, found TO_KW -ERROR@748: expected command, found STDOUT_KW -ERROR@762: expected select stmt -ERROR@762: expected R_PAREN -ERROR@762: expected SEMICOLON -ERROR@786: expected SEMICOLON -ERROR@786: expected command, found R_PAREN -ERROR@788: expected command, found TO_KW -ERROR@791: expected command, found STDOUT_KW -ERROR@871: expected select stmt -ERROR@871: expected R_PAREN -ERROR@871: expected SEMICOLON -ERROR@910: expected SEMICOLON -ERROR@910: expected command, found R_PAREN -ERROR@912: expected command, found TO_KW -ERROR@915: expected command, found STDOUT_KW -ERROR@1039: expected select stmt -ERROR@1039: expected R_PAREN -ERROR@1039: expected SEMICOLON -ERROR@1078: expected SEMICOLON -ERROR@1078: expected command, found R_PAREN -ERROR@1080: expected command, found TO_KW -ERROR@1083: expected command, found STDOUT_KW -ERROR@1238: expected select stmt -ERROR@1238: expected R_PAREN -ERROR@1238: expected SEMICOLON -ERROR@1277: expected SEMICOLON -ERROR@1277: expected command, found R_PAREN -ERROR@1279: expected command, found TO_KW -ERROR@1282: expected command, found STDOUT_KW -ERROR@1428: expected select stmt -ERROR@1428: expected R_PAREN -ERROR@1428: expected SEMICOLON -ERROR@1467: expected SEMICOLON -ERROR@1467: expected command, found R_PAREN -ERROR@1469: expected command, found TO_KW -ERROR@1472: expected command, found STDOUT_KW -ERROR@1583: expected select stmt -ERROR@1583: expected R_PAREN -ERROR@1583: expected SEMICOLON -ERROR@1614: expected SEMICOLON -ERROR@1614: expected command, found R_PAREN -ERROR@1616: expected command, found TO_KW -ERROR@1619: expected command, found STDOUT_KW -ERROR@1743: expected select stmt -ERROR@1743: expected R_PAREN -ERROR@1743: expected SEMICOLON -ERROR@1774: expected SEMICOLON -ERROR@1774: expected command, found R_PAREN -ERROR@1776: expected command, found TO_KW -ERROR@1779: expected command, found STDOUT_KW -ERROR@1934: expected select stmt -ERROR@1934: expected R_PAREN -ERROR@1934: expected SEMICOLON -ERROR@1965: expected SEMICOLON -ERROR@1965: expected command, found R_PAREN -ERROR@1967: expected command, found TO_KW -ERROR@1970: expected command, found STDOUT_KW -ERROR@2116: expected select stmt -ERROR@2116: expected R_PAREN -ERROR@2116: expected SEMICOLON -ERROR@2147: expected SEMICOLON -ERROR@2147: expected command, found R_PAREN -ERROR@2149: expected command, found TO_KW -ERROR@2152: expected command, found STDOUT_KW -ERROR@2263: expected select stmt -ERROR@2263: expected R_PAREN -ERROR@2263: expected SEMICOLON -ERROR@2287: expected SEMICOLON -ERROR@2287: expected command, found R_PAREN -ERROR@2289: expected command, found TO_KW -ERROR@2292: expected command, found STDOUT_KW -ERROR@2431: expected select stmt -ERROR@2431: expected R_PAREN -ERROR@2431: expected SEMICOLON -ERROR@2455: expected SEMICOLON -ERROR@2455: expected command, found R_PAREN -ERROR@2457: expected command, found TO_KW -ERROR@2460: expected command, found STDOUT_KW -ERROR@2645: expected select stmt -ERROR@2645: expected R_PAREN -ERROR@2645: expected SEMICOLON -ERROR@2669: expected SEMICOLON -ERROR@2669: expected command, found R_PAREN -ERROR@2671: expected command, found TO_KW -ERROR@2674: expected command, found STDOUT_KW -ERROR@2835: expected select stmt -ERROR@2835: expected R_PAREN -ERROR@2835: expected SEMICOLON -ERROR@2859: expected SEMICOLON -ERROR@2859: expected command, found R_PAREN -ERROR@2861: expected command, found TO_KW -ERROR@2864: expected command, found STDOUT_KW -ERROR@2987: expected select stmt -ERROR@2987: expected R_PAREN -ERROR@2987: expected SEMICOLON -ERROR@3026: expected SEMICOLON -ERROR@3026: expected command, found R_PAREN -ERROR@3028: expected command, found TO_KW -ERROR@3031: expected command, found STDOUT_KW -ERROR@3589: expected select stmt -ERROR@3589: expected R_PAREN -ERROR@3589: expected SEMICOLON -ERROR@3643: expected SEMICOLON -ERROR@3643: expected command, found R_PAREN -ERROR@3645: expected command, found TO_KW -ERROR@3648: expected command, found STDOUT_KW -ERROR@3662: expected select stmt -ERROR@3662: expected R_PAREN -ERROR@3662: expected SEMICOLON -ERROR@3720: expected SEMICOLON -ERROR@3720: expected command, found R_PAREN -ERROR@3722: expected command, found TO_KW -ERROR@3725: expected command, found STDOUT_KW -ERROR@3739: expected select stmt -ERROR@3739: expected R_PAREN -ERROR@3739: expected SEMICOLON -ERROR@3790: expected SEMICOLON -ERROR@3790: expected command, found R_PAREN -ERROR@3792: expected command, found TO_KW -ERROR@3795: expected command, found STDOUT_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_copyselect.snap b/crates/squawk_parser/tests/snapshots/tests__regression_copyselect.snap index 05885ab0..f0003eae 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_copyselect.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_copyselect.snap @@ -5,12 +5,6 @@ input_file: crates/squawk_parser/tests/data/regression_suite/copyselect.sql ERROR@1031: expected SEMICOLON ERROR@1032: expected command, found TO_KW ERROR@1035: expected command, found STDOUT_KW -ERROR@1459: expected SEMICOLON -ERROR@1460: expected command, found CSV_KW -ERROR@1464: expected command, found HEADER_KW -ERROR@1471: expected command, found FORCE_KW -ERROR@1477: expected command, found QUOTE_KW -ERROR@1483: expected command, found IDENT ERROR@1742: expected SEMICOLON ERROR@1742: expected command, found ERROR ERROR@1786: expected SEMICOLON diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_am.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_am.snap deleted file mode 100644 index c084c842..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_am.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/create_am.sql ---- -ERROR@3427: expected SEMICOLON -ERROR@3428: expected command, found USING_KW -ERROR@3434: expected command, found IDENT -ERROR@3440: expected command, found FROM_KW -ERROR@3445: expected command, found IDENT -ERROR@3532: expected AS_KW -ERROR@3533: expected command, found USING_KW -ERROR@3538: expected SELECT -ERROR@3538: expected SEMICOLON -ERROR@3539: expected command, found IDENT -ERROR@3545: expected command, found AS_KW -ERROR@3656: expected SEMICOLON -ERROR@3657: expected command, found USING_KW -ERROR@3663: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_drop_if_exists.snap b/crates/squawk_parser/tests/snapshots/tests__regression_drop_if_exists.snap deleted file mode 100644 index 9acb6cd6..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_drop_if_exists.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/drop_if_exists.sql ---- -ERROR@7333: expected SEMICOLON -ERROR@7333: expected command, found DOT -ERROR@7334: expected command, found IDENT -ERROR@7391: expected SEMICOLON -ERROR@7391: expected command, found DOT -ERROR@7392: expected command, found IDENT -ERROR@7445: expected SEMICOLON -ERROR@7445: expected command, found DOT -ERROR@7446: expected command, found IDENT -ERROR@7501: expected SEMICOLON -ERROR@7501: expected command, found DOT -ERROR@7502: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_merge.snap b/crates/squawk_parser/tests/snapshots/tests__regression_merge.snap index 0687815b..3040f6fa 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_merge.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_merge.snap @@ -63,13 +63,6 @@ ERROR@2347: expected SEMICOLON ERROR@2348: expected command, found IDENT ERROR@2356: expected command, found EQ ERROR@2358: expected command, found INT_NUMBER -ERROR@2651: expected select stmt -ERROR@2651: expected R_PAREN -ERROR@2651: expected SEMICOLON -ERROR@2721: expected SEMICOLON -ERROR@2722: expected command, found R_PAREN -ERROR@2724: expected command, found TO_KW -ERROR@2727: expected command, found STDOUT_KW ERROR@22860: expected IDENT ERROR@22860: expected SEMICOLON ERROR@22861: expected command, found ACTION_KW @@ -190,13 +183,6 @@ ERROR@24223: expected command, found AS_KW ERROR@24226: expected command, found L_PAREN ERROR@24518: expected SEMICOLON ERROR@24519: expected command, found R_PAREN -ERROR@24648: expected select stmt -ERROR@24648: expected R_PAREN -ERROR@24648: expected SEMICOLON -ERROR@24974: expected SEMICOLON -ERROR@24975: expected command, found R_PAREN -ERROR@24977: expected command, found TO_KW -ERROR@24980: expected command, found STDOUT_KW ERROR@41486: expected ON_KW ERROR@41493: expected WHEN_KW ERROR@41493: expected MATCHED, or NOT MATCHED diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap index f017474e..41099661 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rangefuncs.snap @@ -6,10 +6,10 @@ ERROR@1221: expected R_PAREN ERROR@1233: expected SEMICOLON ERROR@1233: expected command, found R_PAREN ERROR@1253: expected L_PAREN -ERROR@1253: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@1253: expected R_PAREN -ERROR@1253: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@1256: expected command, found IDENT ERROR@1257: expected command, found COMMA @@ -27,10 +27,10 @@ ERROR@1360: expected L_PAREN ERROR@1372: expected SEMICOLON ERROR@1372: expected command, found R_PAREN ERROR@1392: expected L_PAREN -ERROR@1392: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@1392: expected R_PAREN -ERROR@1392: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@1395: expected command, found IDENT ERROR@1396: expected command, found COMMA @@ -52,10 +52,10 @@ ERROR@1880: expected R_PAREN ERROR@1906: expected SEMICOLON ERROR@1906: expected command, found R_PAREN ERROR@1926: expected L_PAREN -ERROR@1926: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@1926: expected R_PAREN -ERROR@1926: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@1929: expected command, found IDENT ERROR@1930: expected command, found COMMA @@ -81,10 +81,10 @@ ERROR@2745: expected R_PAREN ERROR@2766: expected SEMICOLON ERROR@2766: expected command, found R_PAREN ERROR@2786: expected L_PAREN -ERROR@2786: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@2786: expected R_PAREN -ERROR@2786: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@2789: expected command, found IDENT ERROR@2790: expected command, found COMMA @@ -96,10 +96,10 @@ ERROR@9467: expected R_PAREN ERROR@9760: expected SEMICOLON ERROR@9760: expected command, found R_PAREN ERROR@9794: expected L_PAREN -ERROR@9794: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@9794: expected R_PAREN -ERROR@9794: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@9798: expected command, found IDENT ERROR@9799: expected command, found COMMA @@ -145,10 +145,10 @@ ERROR@9878: expected R_PAREN ERROR@10171: expected SEMICOLON ERROR@10171: expected command, found R_PAREN ERROR@10205: expected L_PAREN -ERROR@10205: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@10205: expected R_PAREN -ERROR@10205: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@10209: expected command, found IDENT ERROR@10210: expected command, found COMMA @@ -194,10 +194,10 @@ ERROR@10328: expected R_PAREN ERROR@10459: expected SEMICOLON ERROR@10459: expected command, found R_PAREN ERROR@10495: expected L_PAREN -ERROR@10495: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@10495: expected R_PAREN -ERROR@10495: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@10499: expected command, found IDENT ERROR@10500: expected command, found COMMA @@ -221,10 +221,10 @@ ERROR@12643: expected L_PAREN ERROR@12663: expected SEMICOLON ERROR@12664: expected command, found R_PAREN ERROR@12684: expected L_PAREN -ERROR@12684: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: IDENT -ERROR@12684: expected R_PAREN -ERROR@12684: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: IDENT 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 command, found L_PAREN ERROR@12687: expected command, found IDENT ERROR@12689: expected command, found COMMA @@ -263,25 +263,26 @@ ERROR@28668: expected SEMICOLON ERROR@28668: expected command, found R_PAREN ERROR@28685: expected AS_KW ERROR@28685: expected L_PAREN -ERROR@28685: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: SEMICOLON -ERROR@28685: expected R_PAREN -ERROR@28685: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: SEMICOLON +ERROR@28685: expected command, found SEMICOLON +ERROR@28686: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement +ERROR@28686: expected R_PAREN ERROR@28722: expected R_PAREN ERROR@28746: expected SEMICOLON ERROR@28746: expected command, found R_PAREN ERROR@28763: expected AS_KW ERROR@28763: expected L_PAREN -ERROR@28763: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: SEMICOLON -ERROR@28763: expected R_PAREN -ERROR@28763: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: SEMICOLON +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@28895: expected R_PAREN ERROR@28919: expected SEMICOLON ERROR@28919: expected command, found R_PAREN ERROR@28936: expected AS_KW ERROR@28936: expected L_PAREN -ERROR@28936: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: SEMICOLON -ERROR@28936: expected R_PAREN -ERROR@28936: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: SEMICOLON +ERROR@28936: expected command, found SEMICOLON +ERROR@28937: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement +ERROR@28937: expected R_PAREN ERROR@29704: expected IDENT ERROR@29704: expected SEMICOLON ERROR@29705: expected command, found REF_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap index 6828f582..c750a6cc 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap @@ -26,54 +26,6 @@ ERROR@51594: expected command, found R_PAREN ERROR@54086: expected R_PAREN ERROR@54149: expected SEMICOLON ERROR@54149: expected command, found R_PAREN -ERROR@54301: expected L_PAREN -ERROR@54315: expected R_PAREN -ERROR@54398: expected L_PAREN -ERROR@54412: expected R_PAREN -ERROR@54583: expected L_PAREN -ERROR@54597: expected R_PAREN -ERROR@54714: expected L_PAREN -ERROR@54728: expected R_PAREN -ERROR@54925: expected L_PAREN -ERROR@54939: expected R_PAREN -ERROR@55027: expected L_PAREN -ERROR@55041: expected R_PAREN -ERROR@55247: expected L_PAREN -ERROR@55261: expected R_PAREN -ERROR@55378: expected L_PAREN -ERROR@55392: expected R_PAREN -ERROR@55952: expected L_PAREN -ERROR@55966: expected R_PAREN -ERROR@56023: expected L_PAREN -ERROR@56037: expected R_PAREN -ERROR@56182: expected L_PAREN -ERROR@56196: expected R_PAREN -ERROR@56287: expected L_PAREN -ERROR@56301: expected R_PAREN -ERROR@56472: expected L_PAREN -ERROR@56486: expected R_PAREN -ERROR@56548: expected L_PAREN -ERROR@56562: expected R_PAREN -ERROR@56742: expected L_PAREN -ERROR@56756: expected R_PAREN -ERROR@56840: expected L_PAREN -ERROR@56854: expected R_PAREN -ERROR@57217: expected L_PAREN -ERROR@57231: expected R_PAREN -ERROR@57288: expected L_PAREN -ERROR@57302: expected R_PAREN -ERROR@57447: expected L_PAREN -ERROR@57461: expected R_PAREN -ERROR@57552: expected L_PAREN -ERROR@57566: expected R_PAREN -ERROR@57737: expected L_PAREN -ERROR@57751: expected R_PAREN -ERROR@57813: expected L_PAREN -ERROR@57827: expected R_PAREN -ERROR@58007: expected L_PAREN -ERROR@58021: expected R_PAREN -ERROR@58105: expected L_PAREN -ERROR@58119: expected R_PAREN 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_rules.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap index ed3ffc54..ed5dc08f 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rules.snap @@ -25,10 +25,10 @@ ERROR@6160: expected command, found BOTH_KW ERROR@6165: expected command, found ROWS_KW ERROR@6176: expected AS_KW ERROR@6176: expected L_PAREN -ERROR@6176: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: EQ -ERROR@6176: expected R_PAREN -ERROR@6176: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: EQ 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@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 acb3ea87..257ef8af 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_sqljson.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_sqljson.snap @@ -316,10 +316,10 @@ ERROR@10782: expected command, found IDENT ERROR@10789: expected name ERROR@10789: expected AS_KW ERROR@10789: expected L_PAREN -ERROR@10789: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@10789: expected R_PAREN -ERROR@10789: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@10796: expected command, found KEYS_KW ERROR@10800: expected command, found R_PAREN ERROR@10802: expected command, found FROM_KW @@ -342,10 +342,10 @@ ERROR@10891: expected command, found NULL_KW ERROR@10901: expected name ERROR@10901: expected AS_KW ERROR@10901: expected L_PAREN -ERROR@10901: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@10901: expected R_PAREN -ERROR@10901: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@10908: expected command, found KEYS_KW ERROR@10912: expected command, found R_PAREN ERROR@10914: expected command, found FROM_KW @@ -368,10 +368,10 @@ ERROR@11003: expected command, found NULL_KW ERROR@11013: expected name ERROR@11013: expected AS_KW ERROR@11013: expected L_PAREN -ERROR@11013: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@11013: expected R_PAREN -ERROR@11013: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@11020: expected command, found KEYS_KW ERROR@11024: expected command, found R_PAREN ERROR@11026: expected command, found FROM_KW @@ -391,10 +391,10 @@ ERROR@11125: expected command, found IDENT ERROR@11132: expected name ERROR@11132: expected AS_KW ERROR@11132: expected L_PAREN -ERROR@11132: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@11132: expected R_PAREN -ERROR@11132: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@11139: expected command, found KEYS_KW ERROR@11144: expected command, found RETURNING_KW ERROR@11154: expected command, found IDENT @@ -419,10 +419,10 @@ ERROR@11250: expected command, found NULL_KW ERROR@11260: expected name ERROR@11260: expected AS_KW ERROR@11260: expected L_PAREN -ERROR@11260: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@11260: expected R_PAREN -ERROR@11260: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@11267: expected command, found KEYS_KW ERROR@11272: expected command, found RETURNING_KW ERROR@11282: expected command, found IDENT @@ -447,10 +447,10 @@ ERROR@11378: expected command, found NULL_KW ERROR@11388: expected name ERROR@11388: expected AS_KW ERROR@11388: expected L_PAREN -ERROR@11388: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@11388: expected R_PAREN -ERROR@11388: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@11395: expected command, found KEYS_KW ERROR@11400: expected command, found RETURNING_KW ERROR@11410: expected command, found IDENT @@ -479,11 +479,9 @@ ERROR@11550: expected command, found JSON_KW ERROR@11560: expected name ERROR@11560: expected AS_KW ERROR@11560: expected L_PAREN -ERROR@11560: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@11560: expected R_PAREN -ERROR@11560: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW ERROR@11560: expected command, found UNIQUE_KW -ERROR@11566: expected command, found R_PAREN +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@11568: expected command, found FROM_KW ERROR@11573: expected command, found IDENT ERROR@11588: expected command, found L_PAREN @@ -499,10 +497,10 @@ ERROR@11917: expected command, found IDENT ERROR@11924: expected name ERROR@11924: expected AS_KW ERROR@11924: expected L_PAREN -ERROR@11924: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@11924: expected R_PAREN -ERROR@11924: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@11931: expected command, found KEYS_KW ERROR@11935: expected command, found R_PAREN ERROR@11937: expected command, found OVER_KW @@ -528,10 +526,10 @@ ERROR@12034: expected command, found IDENT ERROR@12041: expected name ERROR@12041: expected AS_KW ERROR@12041: expected L_PAREN -ERROR@12041: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@12041: expected R_PAREN -ERROR@12041: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@12048: expected command, found KEYS_KW ERROR@12052: expected command, found R_PAREN ERROR@12054: expected command, found OVER_KW @@ -560,10 +558,10 @@ ERROR@12170: expected command, found NULL_KW ERROR@12180: expected name ERROR@12180: expected AS_KW ERROR@12180: expected L_PAREN -ERROR@12180: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@12180: expected R_PAREN -ERROR@12180: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@12187: expected command, found KEYS_KW ERROR@12191: expected command, found R_PAREN ERROR@12196: expected command, found OVER_KW @@ -654,10 +652,10 @@ ERROR@12910: expected command, found JSON_KW ERROR@12920: expected name ERROR@12920: expected AS_KW ERROR@12920: expected L_PAREN -ERROR@12920: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@12920: expected R_PAREN -ERROR@12920: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@12927: expected command, found RETURNING_KW ERROR@12937: expected command, found TEXT_KW ERROR@12941: expected command, found R_PAREN @@ -693,10 +691,10 @@ ERROR@13075: expected command, found JSON_KW ERROR@13085: expected name ERROR@13085: expected AS_KW ERROR@13085: expected L_PAREN -ERROR@13085: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@13085: expected R_PAREN -ERROR@13085: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@13092: expected command, found RETURNING_KW ERROR@13102: expected command, found TEXT_KW ERROR@13106: expected command, found R_PAREN @@ -733,10 +731,10 @@ ERROR@13251: expected command, found JSON_KW ERROR@13261: expected name ERROR@13261: expected AS_KW ERROR@13261: expected L_PAREN -ERROR@13261: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@13261: expected R_PAREN -ERROR@13261: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@13268: expected command, found RETURNING_KW ERROR@13278: expected command, found TEXT_KW ERROR@13282: expected command, found R_PAREN @@ -843,10 +841,10 @@ ERROR@15117: expected SEMICOLON ERROR@15123: expected name ERROR@15123: expected AS_KW ERROR@15123: expected L_PAREN -ERROR@15123: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@15123: expected R_PAREN -ERROR@15123: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@15130: expected command, found KEYS_KW ERROR@15135: expected command, found IDENT ERROR@15149: expected command, found FROM_KW @@ -863,10 +861,10 @@ ERROR@15421: expected SEMICOLON ERROR@15427: expected name ERROR@15427: expected AS_KW ERROR@15427: expected L_PAREN -ERROR@15427: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@15427: expected R_PAREN -ERROR@15427: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@15434: expected command, found KEYS_KW ERROR@15439: expected command, found IDENT ERROR@15453: expected command, found FROM_KW @@ -887,10 +885,10 @@ ERROR@15774: expected SEMICOLON ERROR@15780: expected name ERROR@15780: expected AS_KW ERROR@15780: expected L_PAREN -ERROR@15780: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@15780: expected R_PAREN -ERROR@15780: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@15787: expected command, found KEYS_KW ERROR@15792: expected command, found IDENT ERROR@15806: expected command, found FROM_KW @@ -913,10 +911,10 @@ ERROR@16136: expected SEMICOLON ERROR@16142: expected name ERROR@16142: expected AS_KW ERROR@16142: expected L_PAREN -ERROR@16142: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@16142: expected R_PAREN -ERROR@16142: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@16149: expected command, found KEYS_KW ERROR@16154: expected command, found IDENT ERROR@16168: expected command, found FROM_KW @@ -944,10 +942,10 @@ ERROR@16409: expected command, found OBJECT_KW ERROR@16421: expected name ERROR@16421: expected AS_KW ERROR@16421: expected L_PAREN -ERROR@16421: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@16421: expected R_PAREN -ERROR@16421: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@16428: expected command, found AS_KW ERROR@16431: expected command, found IDENT ERROR@16440: expected command, found FROM_KW @@ -977,10 +975,10 @@ ERROR@16615: expected command, found OBJECT_KW ERROR@16627: expected name ERROR@16627: expected AS_KW ERROR@16627: expected L_PAREN -ERROR@16627: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@16627: expected R_PAREN -ERROR@16627: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@16634: expected command, found AS_KW ERROR@16637: expected command, found IDENT ERROR@16646: expected command, found FROM_KW @@ -1029,10 +1027,10 @@ ERROR@17140: expected command, found JSON_KW ERROR@17150: expected name ERROR@17150: expected AS_KW ERROR@17150: expected L_PAREN -ERROR@17150: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: UNIQUE_KW -ERROR@17150: expected R_PAREN -ERROR@17150: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: UNIQUE_KW 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@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_stats.snap b/crates/squawk_parser/tests/snapshots/tests__regression_stats.snap index e08c2b35..aa40bb28 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_stats.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_stats.snap @@ -4,8 +4,7 @@ input_file: crates/squawk_parser/tests/data/regression_suite/stats.sql --- ERROR@25578: expected command, found IDENT ERROR@25905: expected command, found IDENT -ERROR@26237: expected command, found IDENT -ERROR@29133: expected command, found IDENT -ERROR@30029: expected command, found IDENT -ERROR@31778: expected command, found IDENT -ERROR@32440: expected command, found IDENT +ERROR@29136: expected command, found IDENT +ERROR@30032: expected command, found IDENT +ERROR@31781: expected command, found IDENT +ERROR@32443: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap b/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap index 436194ab..7fd48401 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_strings.snap @@ -12,526 +12,181 @@ ERROR@529: expected column label, got BYTE_STRING ERROR@548: missing comma ERROR@610: missing comma ERROR@647: expected column label, got BYTE_STRING -ERROR@1059: missing comma -ERROR@1085: missing comma -ERROR@1086: expected SEMICOLON -ERROR@1086: expected command, found ERROR -ERROR@1087: expected command, found IDENT -ERROR@1088: expected command, found IDENT -ERROR@1393: expected command, found IDENT -ERROR@1394: expected command, found ERROR -ERROR@1395: expected command, found INT_NUMBER -ERROR@1399: expected command, found IDENT -ERROR@1400: expected command, found ERROR -ERROR@1401: expected command, found PLUS -ERROR@1402: expected command, found INT_NUMBER -ERROR@1408: expected command, found IDENT -ERROR@1456: expected command, found IDENT -ERROR@1457: expected command, found STAR -ERROR@1458: expected command, found INT_NUMBER -ERROR@1462: expected command, found IDENT -ERROR@1463: expected command, found ERROR -ERROR@1464: expected command, found PLUS -ERROR@1465: expected command, found INT_NUMBER -ERROR@1471: expected command, found IDENT -ERROR@1517: expected command, found IDENT -ERROR@1523: expected command, found IDENT -ERROR@1548: expected command, found ERROR -ERROR@1549: expected command, found IDENT -ERROR@2740: expected command, found TEXT_KW -ERROR@2744: expected command, found L_PAREN -ERROR@2745: expected command, found CHAR_KW -ERROR@2749: expected command, found R_PAREN -ERROR@2750: expected command, found IDENT -ERROR@2796: expected command, found TEXT_KW -ERROR@2800: expected command, found L_PAREN -ERROR@2801: expected command, found VARCHAR_KW -ERROR@2808: expected command, found R_PAREN -ERROR@2809: expected command, found IDENT -ERROR@2872: expected command, found TEXT_KW -ERROR@2876: expected command, found L_PAREN -ERROR@2877: expected command, found NAME_KW -ERROR@2881: expected command, found R_PAREN -ERROR@2882: expected command, found IDENT -ERROR@2983: expected command, found CHAR_KW -ERROR@2987: expected command, found L_PAREN -ERROR@2988: expected command, found TEXT_KW -ERROR@2992: expected command, found R_PAREN -ERROR@2993: expected command, found IDENT -ERROR@3093: expected command, found CHAR_KW -ERROR@3097: expected command, found L_PAREN -ERROR@3098: expected command, found TEXT_KW -ERROR@3102: expected command, found R_PAREN -ERROR@3103: expected command, found IDENT -ERROR@3153: expected command, found CHAR_KW -ERROR@3157: expected command, found L_PAREN -ERROR@3158: expected command, found VARCHAR_KW -ERROR@3165: expected command, found R_PAREN -ERROR@3166: expected command, found IDENT -ERROR@3233: expected command, found CHAR_KW -ERROR@3237: expected command, found L_PAREN -ERROR@3238: expected command, found NAME_KW -ERROR@3242: expected command, found R_PAREN -ERROR@3243: expected command, found IDENT -ERROR@3278: expected command, found VARCHAR_KW -ERROR@3285: expected command, found L_PAREN -ERROR@3286: expected command, found TEXT_KW -ERROR@3290: expected command, found R_PAREN -ERROR@3291: expected command, found IDENT -ERROR@3340: expected command, found VARCHAR_KW -ERROR@3347: expected command, found L_PAREN -ERROR@3348: expected command, found CHAR_KW -ERROR@3352: expected command, found R_PAREN -ERROR@3353: expected command, found IDENT -ERROR@3416: expected command, found VARCHAR_KW -ERROR@3423: expected command, found L_PAREN -ERROR@3424: expected command, found NAME_KW -ERROR@3428: expected command, found R_PAREN -ERROR@3429: expected command, found IDENT -ERROR@3619: expected command, found IDENT -ERROR@3625: expected command, found IDENT -ERROR@3627: expected command, found IDENT -ERROR@3633: expected command, found IDENT -ERROR@3709: expected command, found IDENT -ERROR@3715: expected command, found IDENT -ERROR@3717: expected command, found IDENT -ERROR@3725: expected command, found IDENT -ERROR@3804: expected command, found IDENT -ERROR@3810: expected command, found IDENT -ERROR@3812: expected command, found IDENT -ERROR@3818: expected command, found IDENT -ERROR@3885: expected command, found SOME_KW -ERROR@3890: expected command, found IDENT -ERROR@3892: expected command, found IDENT -ERROR@3983: expected command, found INT_NUMBER -ERROR@3991: expected command, found IDENT -ERROR@4051: expected command, found INT_NUMBER -ERROR@4054: expected command, found IDENT -ERROR@4134: expected command, found IDENT -ERROR@4139: expected command, found IDENT -ERROR@4197: expected command, found STRING_KW -ERROR@4203: expected command, found IDENT -ERROR@4262: expected command, found IDENT -ERROR@4267: expected command, found IDENT -ERROR@4382: expected command, found L_PAREN -ERROR@4383: expected command, found IDENT -ERROR@4386: expected command, found R_PAREN -ERROR@4387: expected command, found POUND -ERROR@4388: expected command, found IDENT -ERROR@4408: expected command, found IDENT -ERROR@4411: expected command, found IDENT -ERROR@4475: expected command, found L_PAREN -ERROR@4476: expected command, found IDENT -ERROR@4479: expected command, found R_PAREN -ERROR@4480: expected command, found POUND -ERROR@4481: expected command, found IDENT -ERROR@4498: expected command, found IDENT -ERROR@4501: expected command, found IDENT -ERROR@4574: expected command, found L_PAREN -ERROR@4575: expected command, found IDENT -ERROR@4578: expected command, found R_PAREN -ERROR@4579: expected command, found POUND -ERROR@4580: expected command, found IDENT -ERROR@4608: expected command, found TRUE_KW -ERROR@4612: expected command, found IDENT -ERROR@4714: expected command, found TRUE_KW -ERROR@4718: expected command, found IDENT -ERROR@4779: expected command, found TRUE_KW -ERROR@4783: expected command, found IDENT -ERROR@4850: expected command, found TRUE_KW -ERROR@4854: expected command, found IDENT -ERROR@4947: expected command, found PERCENT -ERROR@4948: expected command, found POUND -ERROR@4949: expected command, found IDENT -ERROR@4969: expected command, found IDENT -ERROR@4974: expected command, found IDENT -ERROR@5017: expected command, found PERCENT -ERROR@5018: expected command, found POUND -ERROR@5019: expected command, found IDENT -ERROR@5040: expected command, found IDENT -ERROR@5047: expected command, found IDENT -ERROR@5143: expected command, found PERCENT -ERROR@5144: expected command, found POUND -ERROR@5145: expected command, found IDENT -ERROR@5165: expected command, found IDENT -ERROR@5170: expected command, found IDENT -ERROR@5212: expected command, found PERCENT -ERROR@5213: expected command, found POUND -ERROR@5214: expected command, found IDENT -ERROR@5236: expected command, found IDENT -ERROR@5241: expected command, found IDENT -ERROR@5283: expected command, found PERCENT -ERROR@5284: expected command, found PIPE -ERROR@5285: expected command, found IDENT -ERROR@5287: expected command, found POUND -ERROR@5288: expected command, found IDENT -ERROR@5308: expected command, found IDENT -ERROR@5313: expected command, found IDENT -ERROR@5401: expected command, found PERCENT -ERROR@5402: expected command, found POUND -ERROR@5403: expected command, found IDENT -ERROR@5408: expected command, found BYTE_STRING -ERROR@5419: expected command, found POUND -ERROR@5420: expected command, found STRING -ERROR@5531: expected command, found IDENT -ERROR@5538: expected command, found STRING -ERROR@5549: expected command, found IDENT -ERROR@5550: expected command, found POUND -ERROR@5551: expected command, found IDENT -ERROR@5572: expected command, found IDENT -ERROR@5578: expected command, found IDENT -ERROR@5638: expected command, found IDENT -ERROR@5645: expected command, found IDENT -ERROR@5831: expected command, found IDENT -ERROR@5834: expected command, found IDENT -ERROR@5960: expected command, found IDENT -ERROR@5963: expected command, found IDENT -ERROR@6523: expected command, found NO_KW -ERROR@6526: expected command, found IDENT -ERROR@6532: expected command, found IDENT -ERROR@15440: expected command, found INT_NUMBER -ERROR@15441: expected command, found IDENT -ERROR@15492: expected command, found INT_NUMBER -ERROR@15493: expected command, found IDENT -ERROR@15549: expected command, found INT_NUMBER -ERROR@15550: expected command, found IDENT -ERROR@15611: expected command, found INT_NUMBER -ERROR@15612: expected command, found IDENT -ERROR@15669: expected command, found INT_NUMBER -ERROR@15670: expected command, found IDENT -ERROR@15731: expected command, found INT_NUMBER -ERROR@15732: expected command, found IDENT -ERROR@15801: expected command, found INT_NUMBER -ERROR@15802: expected command, found IDENT -ERROR@15890: expected command, found IDENT -ERROR@15896: expected command, found IDENT -ERROR@15952: expected command, found IDENT -ERROR@15960: expected command, found IDENT -ERROR@16022: expected command, found IDENT -ERROR@16033: expected command, found IDENT -ERROR@16093: expected command, found IDENT -ERROR@16098: expected command, found IDENT -ERROR@16255: expected command, found TRUE_KW -ERROR@16259: expected command, found IDENT -ERROR@16297: expected command, found FALSE_KW -ERROR@16302: expected command, found IDENT -ERROR@16337: expected command, found FALSE_KW -ERROR@16342: expected command, found IDENT -ERROR@16380: expected command, found TRUE_KW -ERROR@16384: expected command, found IDENT -ERROR@16423: expected command, found FALSE_KW -ERROR@16428: expected command, found IDENT -ERROR@16470: expected command, found TRUE_KW -ERROR@16474: expected command, found IDENT -ERROR@16512: expected command, found TRUE_KW -ERROR@16516: expected command, found IDENT -ERROR@16557: expected command, found FALSE_KW -ERROR@16562: expected command, found IDENT -ERROR@16598: expected command, found TRUE_KW -ERROR@16602: expected command, found IDENT -ERROR@16641: expected command, found FALSE_KW -ERROR@16646: expected command, found IDENT -ERROR@16682: expected command, found TRUE_KW -ERROR@16686: expected command, found IDENT -ERROR@16725: expected command, found FALSE_KW -ERROR@16730: expected command, found IDENT -ERROR@16765: expected command, found FALSE_KW -ERROR@16770: expected command, found IDENT -ERROR@16808: expected command, found TRUE_KW -ERROR@16812: expected command, found IDENT -ERROR@16850: expected command, found TRUE_KW -ERROR@16854: expected command, found IDENT -ERROR@16895: expected command, found FALSE_KW -ERROR@16900: expected command, found IDENT -ERROR@16946: expected command, found TRUE_KW -ERROR@16950: expected command, found IDENT -ERROR@16999: expected command, found FALSE_KW -ERROR@17004: expected command, found IDENT -ERROR@17077: expected command, found TRUE_KW -ERROR@17081: expected command, found IDENT -ERROR@17130: expected command, found FALSE_KW -ERROR@17135: expected command, found IDENT -ERROR@17182: expected command, found TRUE_KW -ERROR@17186: expected command, found IDENT -ERROR@17236: expected command, found FALSE_KW -ERROR@17241: expected command, found IDENT -ERROR@17348: expected command, found TRUE_KW -ERROR@17352: expected command, found IDENT -ERROR@17397: expected command, found FALSE_KW -ERROR@17402: expected command, found IDENT -ERROR@17449: expected command, found FALSE_KW -ERROR@17454: expected command, found IDENT -ERROR@17504: expected command, found TRUE_KW -ERROR@17508: expected command, found IDENT -ERROR@17556: expected command, found TRUE_KW -ERROR@17560: expected command, found IDENT -ERROR@17611: expected command, found FALSE_KW -ERROR@17616: expected command, found IDENT -ERROR@17669: expected command, found TRUE_KW -ERROR@17673: expected command, found IDENT -ERROR@17729: expected command, found FALSE_KW -ERROR@17734: expected command, found IDENT -ERROR@17781: expected command, found TRUE_KW -ERROR@17785: expected command, found IDENT -ERROR@17835: expected command, found FALSE_KW -ERROR@17840: expected command, found IDENT -ERROR@17888: expected command, found TRUE_KW -ERROR@17892: expected command, found IDENT -ERROR@17943: expected command, found FALSE_KW -ERROR@17948: expected command, found IDENT -ERROR@17997: expected command, found FALSE_KW -ERROR@18002: expected command, found IDENT -ERROR@18054: expected command, found TRUE_KW -ERROR@18058: expected command, found IDENT -ERROR@18106: expected command, found TRUE_KW -ERROR@18110: expected command, found IDENT -ERROR@18161: expected command, found FALSE_KW -ERROR@18166: expected command, found IDENT -ERROR@18231: expected command, found TRUE_KW -ERROR@18235: expected command, found IDENT -ERROR@18303: expected command, found FALSE_KW -ERROR@18308: expected command, found IDENT -ERROR@18400: expected command, found TRUE_KW -ERROR@18404: expected command, found IDENT -ERROR@18453: expected command, found FALSE_KW -ERROR@18458: expected command, found IDENT -ERROR@18505: expected command, found TRUE_KW -ERROR@18509: expected command, found IDENT -ERROR@18559: expected command, found FALSE_KW -ERROR@18564: expected command, found IDENT -ERROR@18610: expected command, found TRUE_KW -ERROR@18614: expected command, found IDENT -ERROR@18663: expected command, found FALSE_KW -ERROR@18668: expected command, found IDENT -ERROR@18715: expected command, found TRUE_KW -ERROR@18719: expected command, found IDENT -ERROR@18769: expected command, found FALSE_KW -ERROR@18774: expected command, found IDENT -ERROR@18821: expected command, found FALSE_KW -ERROR@18826: expected command, found IDENT -ERROR@18876: expected command, found TRUE_KW -ERROR@18880: expected command, found IDENT -ERROR@19020: expected command, found TRUE_KW -ERROR@19024: expected command, found IDENT -ERROR@19063: expected command, found FALSE_KW -ERROR@19068: expected command, found IDENT -ERROR@19104: expected command, found TRUE_KW -ERROR@19108: expected command, found IDENT -ERROR@19147: expected command, found FALSE_KW -ERROR@19152: expected command, found IDENT -ERROR@19191: expected command, found TRUE_KW -ERROR@19195: expected command, found IDENT -ERROR@19237: expected command, found FALSE_KW -ERROR@19242: expected command, found IDENT -ERROR@19278: expected command, found TRUE_KW -ERROR@19282: expected command, found IDENT -ERROR@19321: expected command, found FALSE_KW -ERROR@19326: expected command, found IDENT -ERROR@19365: expected command, found TRUE_KW -ERROR@19369: expected command, found IDENT -ERROR@19411: expected command, found FALSE_KW -ERROR@19416: expected command, found IDENT -ERROR@20198: expected command, found IDENT -ERROR@20205: expected command, found UNKNOWN_KW -ERROR@20213: expected command, found TYPES_KW -ERROR@20218: expected command, found IDENT -ERROR@20263: expected command, found IDENT -ERROR@20270: expected command, found TEXT_KW -ERROR@20275: expected command, found TO_KW -ERROR@20278: expected command, found UNKNOWN_KW -ERROR@20286: expected command, found TYPE_KW -ERROR@20290: expected command, found IDENT -ERROR@20342: expected command, found IDENT -ERROR@20349: expected command, found CHAR_KW -ERROR@20354: expected command, found TO_KW -ERROR@20357: expected command, found UNKNOWN_KW -ERROR@20365: expected command, found TYPE_KW -ERROR@20369: expected command, found IDENT -ERROR@20426: expected command, found IDENT -ERROR@20433: expected command, found TEXT_KW -ERROR@20438: expected command, found TO_KW -ERROR@20441: expected command, found CHAR_KW -ERROR@20445: expected command, found IDENT -ERROR@20498: expected command, found IDENT -ERROR@20505: expected command, found TEXT_KW -ERROR@20510: expected command, found TO_KW -ERROR@20513: expected command, found VARCHAR_KW -ERROR@20520: expected command, found IDENT -ERROR@21146: expected command, found IDENT -ERROR@21155: expected command, found START_KW -ERROR@21160: expected command, found IDENT -ERROR@23103: expected command, found IDENT -ERROR@23112: expected command, found START_KW -ERROR@23117: expected command, found IDENT -ERROR@24079: expected command, found IDENT -ERROR@24087: expected command, found IDENT -ERROR@24147: expected command, found IDENT -ERROR@24152: expected command, found IDENT -ERROR@24190: expected command, found IDENT -ERROR@24195: expected command, found IDENT -ERROR@24231: expected command, found IDENT -ERROR@24236: expected command, found IDENT -ERROR@24268: expected command, found IDENT -ERROR@24273: expected command, found IDENT -ERROR@24303: expected command, found IDENT -ERROR@24308: expected command, found IDENT -ERROR@24375: expected command, found IDENT -ERROR@24381: expected command, found IDENT -ERROR@24432: expected command, found IDENT -ERROR@24445: expected command, found IDENT -ERROR@24490: expected command, found IDENT -ERROR@24494: expected command, found IDENT -ERROR@24555: expected command, found EMPTY_KW -ERROR@24561: expected command, found STRING_KW -ERROR@24567: expected command, found IDENT -ERROR@24604: expected command, found EMPTY_KW -ERROR@24610: expected command, found STRING_KW -ERROR@24616: expected command, found IDENT -ERROR@24669: expected command, found IDENT -ERROR@24676: expected command, found AT -ERROR@24677: expected command, found IDENT -ERROR@24687: expected command, found IDENT -ERROR@24740: expected command, found EMPTY_KW -ERROR@24746: expected command, found STRING_KW -ERROR@24752: expected command, found IDENT -ERROR@24806: expected command, found IDENT -ERROR@24813: expected command, found AT -ERROR@24814: expected command, found IDENT -ERROR@24824: expected command, found IDENT -ERROR@24878: expected command, found EMPTY_KW -ERROR@24884: expected command, found STRING_KW -ERROR@24890: expected command, found IDENT -ERROR@24944: expected command, found IDENT -ERROR@24947: expected command, found IDENT -ERROR@24952: expected command, found IDENT -ERROR@25007: expected command, found IDENT -ERROR@25014: expected command, found AT -ERROR@25015: expected command, found IDENT -ERROR@25025: expected command, found IDENT -ERROR@25080: expected command, found EMPTY_KW -ERROR@25086: expected command, found STRING_KW -ERROR@25092: expected command, found IDENT -ERROR@25146: expected command, found IDENT -ERROR@25153: expected command, found IDENT -ERROR@25207: expected command, found IDENT -ERROR@25217: expected command, found IDENT -ERROR@25271: expected command, found EMPTY_KW -ERROR@25277: expected command, found STRING_KW -ERROR@25283: expected command, found IDENT -ERROR@25339: expected command, found IDENT -ERROR@25346: expected command, found IDENT -ERROR@25401: expected command, found IDENT -ERROR@25411: expected command, found IDENT -ERROR@25466: expected command, found IDENT -ERROR@25473: expected command, found IDENT -ERROR@25528: expected command, found EMPTY_KW -ERROR@25534: expected command, found STRING_KW -ERROR@25540: expected command, found IDENT -ERROR@25597: expected command, found IDENT -ERROR@25607: expected command, found IDENT -ERROR@25677: expected command, found INT_NUMBER -ERROR@25709: expected command, found IDENT -ERROR@25777: expected command, found INT_NUMBER -ERROR@25801: expected command, found IDENT -ERROR@25875: expected command, found INT_NUMBER -ERROR@25907: expected command, found IDENT -ERROR@25936: expected command, found INT_NUMBER -ERROR@25947: expected command, found IDENT -ERROR@25983: expected command, found INT_NUMBER -ERROR@26005: expected command, found IDENT -ERROR@26043: expected command, found INT_NUMBER -ERROR@26051: expected command, found IDENT -ERROR@26125: expected command, found INT_NUMBER -ERROR@26136: expected command, found IDENT -ERROR@26165: expected command, found IDENT -ERROR@26173: expected command, found IDENT -ERROR@26209: expected command, found IDENT -ERROR@26225: expected command, found IDENT -ERROR@26263: expected command, found IDENT -ERROR@26269: expected command, found IDENT -ERROR@26343: expected command, found IDENT -ERROR@26351: expected command, found IDENT -ERROR@28067: expected command, found ERROR -ERROR@28068: expected command, found IDENT -ERROR@28073: expected command, found IDENT -ERROR@28103: expected command, found ERROR -ERROR@28104: expected command, found IDENT -ERROR@28109: expected command, found IDENT -ERROR@28147: expected command, found ERROR -ERROR@28148: expected command, found IDENT -ERROR@28157: expected command, found IDENT -ERROR@28191: expected command, found ERROR -ERROR@28192: expected command, found IDENT -ERROR@28201: expected command, found IDENT -ERROR@28247: expected command, found ERROR -ERROR@28248: expected command, found IDENT -ERROR@28265: expected command, found IDENT -ERROR@28314: expected command, found ERROR -ERROR@28315: expected command, found IDENT -ERROR@28332: expected command, found IDENT -ERROR@28363: expected command, found INT_NUMBER -ERROR@28364: expected command, found IDENT -ERROR@28398: expected command, found INT_NUMBER -ERROR@28400: expected command, found IDENT -ERROR@28436: expected command, found INT_NUMBER -ERROR@28440: expected command, found IDENT -ERROR@28512: expected command, found INT_NUMBER -ERROR@28513: expected command, found IDENT -ERROR@28547: expected command, found INT_NUMBER -ERROR@28549: expected command, found IDENT -ERROR@28589: expected command, found INT_NUMBER -ERROR@28598: expected command, found IDENT -ERROR@28674: expected command, found INT_NUMBER -ERROR@28675: expected command, found IDENT -ERROR@28709: expected command, found INT_NUMBER -ERROR@28711: expected command, found IDENT -ERROR@28759: expected command, found INT_NUMBER -ERROR@28778: expected command, found IDENT -ERROR@28894: expected command, found MINUS -ERROR@28895: expected command, found INT_NUMBER -ERROR@28900: expected command, found IDENT -ERROR@28929: expected command, found INT_NUMBER -ERROR@28934: expected command, found IDENT -ERROR@28974: expected command, found MINUS -ERROR@28975: expected command, found INT_NUMBER -ERROR@28985: expected command, found IDENT -ERROR@29018: expected command, found INT_NUMBER -ERROR@29028: expected command, found IDENT -ERROR@29076: expected command, found MINUS -ERROR@29077: expected command, found INT_NUMBER -ERROR@29096: expected command, found IDENT -ERROR@29144: expected command, found INT_NUMBER -ERROR@29163: expected command, found IDENT -ERROR@30819: expected command, found INT_NUMBER -ERROR@30827: expected command, found IDENT -ERROR@30885: expected command, found INT_NUMBER -ERROR@30888: expected command, found IDENT -ERROR@30951: expected command, found IDENT -ERROR@30956: expected command, found IDENT -ERROR@31021: expected command, found STRING_KW -ERROR@31027: expected command, found IDENT -ERROR@31093: expected command, found IDENT -ERROR@31098: expected command, found IDENT -ERROR@1087: unknown literal prefix -ERROR@3627: unknown literal prefix -ERROR@3812: unknown literal prefix -ERROR@3890: unknown literal prefix -ERROR@4262: unknown literal prefix -ERROR@4408: unknown literal prefix -ERROR@4498: unknown literal prefix -ERROR@4969: unknown literal prefix -ERROR@5165: unknown literal prefix -ERROR@5236: unknown literal prefix -ERROR@5308: unknown literal prefix -ERROR@5572: unknown literal prefix -ERROR@6526: unknown literal prefix -ERROR@16093: unknown literal prefix -ERROR@24947: unknown literal prefix -ERROR@28068: unknown literal prefix -ERROR@28104: unknown literal prefix -ERROR@28148: unknown literal prefix -ERROR@28192: unknown literal prefix -ERROR@28248: unknown literal prefix -ERROR@28315: unknown literal prefix -ERROR@31093: unknown literal prefix -ERROR@31098: Missing trailing " to terminate the quoted identifier +ERROR@652: missing comma +ERROR@748: missing comma +ERROR@750: expected an expression, found SEMICOLON +ERROR@783: missing comma +ERROR@1390: expected column label, got BYTE_STRING +ERROR@1445: missing comma +ERROR@1453: expected column label, got BYTE_STRING +ERROR@1472: missing comma +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 +ERROR@6702: missing comma +ERROR@6760: missing comma +ERROR@17068: missing comma +ERROR@17121: missing comma +ERROR@17173: missing comma +ERROR@17227: missing comma +ERROR@17339: missing comma +ERROR@17388: missing comma +ERROR@17440: missing comma +ERROR@17495: missing comma +ERROR@17547: missing comma +ERROR@17602: missing comma +ERROR@17660: missing comma +ERROR@17720: missing comma +ERROR@17772: missing comma +ERROR@17826: missing comma +ERROR@17879: missing comma +ERROR@17934: missing comma +ERROR@17988: missing comma +ERROR@18045: missing comma +ERROR@18097: missing comma +ERROR@18152: missing comma +ERROR@18215: missing comma +ERROR@18287: missing comma +ERROR@18391: missing comma +ERROR@18444: missing comma +ERROR@18496: missing comma +ERROR@18550: missing comma +ERROR@18601: missing comma +ERROR@18654: missing comma +ERROR@18706: missing comma +ERROR@18760: missing comma +ERROR@18812: missing comma +ERROR@18867: missing comma +ERROR@19047: missing comma +ERROR@19131: missing comma +ERROR@19218: missing comma +ERROR@19305: missing comma +ERROR@19394: missing comma +ERROR@20309: missing comma +ERROR@20403: missing comma +ERROR@29702: missing comma +ERROR@29713: expected SEMICOLON +ERROR@29713: expected command, found ERROR +ERROR@29714: expected command, found ERROR +ERROR@29715: expected command, found IDENT +ERROR@29716: expected command, found ERROR +ERROR@29717: expected command, found STRING +ERROR@29724: expected command, found AS_KW +ERROR@29727: expected command, found IDENT +ERROR@29729: expected command, found COMMA +ERROR@29731: expected command, found STRING +ERROR@29742: expected command, found AS_KW +ERROR@29745: expected command, found IDENT +ERROR@29747: expected command, found COMMA +ERROR@29749: expected command, found STRING +ERROR@29756: expected command, found IDENT +ERROR@29758: expected command, found STRING +ERROR@29768: expected command, found ERROR +ERROR@29769: expected command, found ERROR +ERROR@29770: expected command, found ERROR +ERROR@29771: expected command, found ERROR +ERROR@29772: expected command, found STRING +ERROR@29862: expected command, found IDENT +ERROR@29863: expected command, found ERROR +ERROR@29864: expected command, found IDENT +ERROR@29867: expected command, found STRING +ERROR@29877: expected command, found IDENT +ERROR@29878: expected command, found ERROR +ERROR@29879: expected command, found BIT_STRING +ERROR@29882: expected command, found IDENT +ERROR@29884: expected command, found STRING +ERROR@29894: expected command, found IDENT +ERROR@29895: expected command, found ERROR +ERROR@29896: expected command, found BIT_STRING +ERROR@29901: expected command, found IDENT +ERROR@29903: expected command, found STRING +ERROR@29913: expected command, found IDENT +ERROR@29917: expected command, found ERROR +ERROR@29918: expected command, found STRING +ERROR@29930: expected command, found IDENT +ERROR@29932: expected command, found ERROR +ERROR@29933: expected command, found STRING +ERROR@29935: expected command, found IDENT +ERROR@29937: expected command, found STRING +ERROR@29947: expected command, found ERROR +ERROR@29948: expected command, found ERROR +ERROR@29949: expected command, found STRING +ERROR@30007: expected command, found IDENT +ERROR@30008: expected command, found ERROR +ERROR@30009: expected command, found ERROR +ERROR@30010: expected command, found IDENT +ERROR@30013: expected command, found STRING +ERROR@30023: expected command, found IDENT +ERROR@30024: expected command, found ERROR +ERROR@30025: expected command, found ERROR +ERROR@30026: expected command, found IDENT +ERROR@30027: expected command, found ERROR +ERROR@30028: expected command, found STRING +ERROR@30033: expected command, found AS_KW +ERROR@30036: expected command, found IDENT +ERROR@30038: expected command, found COMMA +ERROR@30040: expected command, found STRING +ERROR@30049: expected command, found IDENT +ERROR@30051: expected command, found STRING +ERROR@30061: expected command, found IDENT +ERROR@30065: expected command, found ERROR +ERROR@30066: expected command, found ERROR +ERROR@30067: expected command, found STRING +ERROR@30079: expected command, found IDENT +ERROR@30081: expected command, found ERROR +ERROR@30082: expected command, found ERROR +ERROR@30083: expected command, found ERROR +ERROR@30084: expected command, found STRING +ERROR@30089: expected command, found AS_KW +ERROR@30092: expected command, found IDENT +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 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 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 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_subscription.snap b/crates/squawk_parser/tests/snapshots/tests__regression_subscription.snap deleted file mode 100644 index f94409e2..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_subscription.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/subscription.sql ---- -ERROR@386: expected PUBLICATION_KW -ERROR@386: expected name -ERROR@448: expected CONNECTION_KW -ERROR@448: expected string literal diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap b/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap index 6bc64c34..7c409628 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_subselect.snap @@ -2,12 +2,12 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/subselect.sql --- -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 -ERROR@31606: expected SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE, CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS -ERROR@31606: expected SEMICOLON 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 @@ -16,10 +16,10 @@ ERROR@31644: expected command, found L_PAREN ERROR@31777: expected SEMICOLON ERROR@31777: expected command, found R_PAREN ERROR@31778: expected command, found R_PAREN -ERROR@31824: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: L_PAREN -ERROR@31824: expected R_PAREN -ERROR@31824: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_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 @@ -28,12 +28,12 @@ ERROR@31862: expected command, found L_PAREN ERROR@31995: expected SEMICOLON ERROR@31995: expected command, found R_PAREN ERROR@31996: expected command, found R_PAREN -ERROR@32071: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: L_PAREN -ERROR@32071: expected R_PAREN -ERROR@32071: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN -ERROR@32071: expected SELECT, INSERT, UPDATE, DELETE, MERGE, VALUES, EXECUTE, DECLARE, CREATE TABLE AS, or CREATE MATERIALIZED VIEW AS -ERROR@32071: expected SEMICOLON 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 @@ -42,10 +42,10 @@ ERROR@32109: expected command, found L_PAREN ERROR@32221: expected SEMICOLON ERROR@32221: expected command, found R_PAREN ERROR@32222: expected command, found R_PAREN -ERROR@32268: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: L_PAREN -ERROR@32268: expected R_PAREN -ERROR@32268: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_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 97e351b6..0967e359 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap @@ -2,18 +2,13 @@ source: crates/squawk_parser/tests/tests.rs expression: "out.join(\"\\n\")" --- -tests/snapshots/tests__regression_copy.snap:231 -tests/snapshots/tests__regression_copy2.snap:58 -tests/snapshots/tests__regression_copydml.snap:154 -tests/snapshots/tests__regression_copyselect.snap:27 -tests/snapshots/tests__regression_create_am.snap:14 +tests/snapshots/tests__regression_copyselect.snap:21 tests/snapshots/tests__regression_create_index.snap:10 tests/snapshots/tests__regression_create_operator.snap:17 tests/snapshots/tests__regression_create_table.snap:31 tests/snapshots/tests__regression_create_table_like.snap:20 tests/snapshots/tests__regression_create_view.snap:265 tests/snapshots/tests__regression_domain.snap:35 -tests/snapshots/tests__regression_drop_if_exists.snap:12 tests/snapshots/tests__regression_errors.snap:286 tests/snapshots/tests__regression_foreign_data.snap:57 tests/snapshots/tests__regression_foreign_key.snap:24 @@ -25,7 +20,7 @@ tests/snapshots/tests__regression_insert.snap:19 tests/snapshots/tests__regression_insert_conflict.snap:253 tests/snapshots/tests__regression_join.snap:20 tests/snapshots/tests__regression_largeobject.snap:12 -tests/snapshots/tests__regression_merge.snap:384 +tests/snapshots/tests__regression_merge.snap:370 tests/snapshots/tests__regression_misc.snap:8 tests/snapshots/tests__regression_misc_functions.snap:9 tests/snapshots/tests__regression_namespace.snap:4 @@ -34,18 +29,17 @@ tests/snapshots/tests__regression_partition_prune.snap:330 tests/snapshots/tests__regression_plpgsql.snap:128 tests/snapshots/tests__regression_privileges.snap:84 tests/snapshots/tests__regression_publication.snap:71 -tests/snapshots/tests__regression_rangefuncs.snap:290 +tests/snapshots/tests__regression_rangefuncs.snap:291 tests/snapshots/tests__regression_returning.snap:230 -tests/snapshots/tests__regression_rowsecurity.snap:75 +tests/snapshots/tests__regression_rowsecurity.snap:27 tests/snapshots/tests__regression_rules.snap:59 tests/snapshots/tests__regression_select_parallel.snap:3 -tests/snapshots/tests__regression_sqljson.snap:1075 +tests/snapshots/tests__regression_sqljson.snap:1073 tests/snapshots/tests__regression_sqljson_jsontable.snap:185 tests/snapshots/tests__regression_sqljson_queryfuncs.snap:51 -tests/snapshots/tests__regression_stats.snap:7 +tests/snapshots/tests__regression_stats.snap:6 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_strings.snap:188 tests/snapshots/tests__regression_subselect.snap:52 tests/snapshots/tests__regression_tablesample.snap:6 tests/snapshots/tests__regression_timestamp.snap:65 diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_timestamptz.snap b/crates/squawk_parser/tests/snapshots/tests__regression_timestamptz.snap index c059e0e0..b4a51da1 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_timestamptz.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_timestamptz.snap @@ -5,10 +5,10 @@ input_file: crates/squawk_parser/tests/data/regression_suite/timestamptz.sql ERROR@1583: expected SEMICOLON ERROR@1593: expected AS_KW ERROR@1593: expected L_PAREN -ERROR@1593: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: ZONE_KW -ERROR@1593: expected R_PAREN -ERROR@1593: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: ZONE_KW ERROR@1594: expected command, found ZONE_KW +ERROR@1598: expected SELECT, TABLE, VALUES, INSERT, UPDATE, DELETE, or MERGE statement +ERROR@1598: expected R_PAREN +ERROR@1598: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: STRING ERROR@1599: expected command, found STRING ERROR@28897: expected COMMA ERROR@28900: expected COMMA diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_with.snap b/crates/squawk_parser/tests/snapshots/tests__regression_with.snap index 4c5a1fb6..9750b82a 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_with.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_with.snap @@ -2,10 +2,10 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/with.sql --- -ERROR@23239: expected DELETE, SELECT, TABLE, VALUES, INSERT, WITH, or UPDATE, got: L_PAREN -ERROR@23239: expected R_PAREN -ERROR@23239: expected DELETE, SELECT, TABLE, UPDATE, or MERGE, got: L_PAREN 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@23288: expected SEMICOLON ERROR@23288: expected command, found R_PAREN ERROR@23292: expected command, found UNION_KW diff --git a/playground/src/App.tsx b/playground/src/App.tsx index 86e2bf7a..40feacdf 100644 --- a/playground/src/App.tsx +++ b/playground/src/App.tsx @@ -384,48 +384,44 @@ function ErrorList({ errors }: { errors: Marker[] }) { if (errors.length === 0) { return
no errors!
} - return ( - <> - {errors.map((x) => { - const color = - x.severity === monaco.MarkerSeverity.Warning - ? "border-l-amber-300" - : x.severity === monaco.MarkerSeverity.Error - ? "border-l-red-400" - : "" - const code = typeof x.code === "string" ? x.code : x.code?.value - return ( -
-
- {code == null ? ( -
{code}
- ) : ( - - {code} - - )} - :{x.startLineNumber}:{x.startColumn}: {x.message} -
- {x.messages.length > 0 && ( -
- {x.messages.map((note) => { - return ( -
- help:{" "} - {note} -
- ) - })} -
- )} + return errors.map((x) => { + const color = + x.severity === monaco.MarkerSeverity.Warning + ? "border-l-amber-300" + : x.severity === monaco.MarkerSeverity.Error + ? "border-l-red-400" + : "" + const code = typeof x.code === "string" ? x.code : x.code?.value + return ( +
+
+ {code == null ? ( +
{code}
+ ) : ( + + {code} + + )} + :{x.startLineNumber}:{x.startColumn}: {x.message} +
+ {x.messages.length > 0 && ( +
+ {x.messages.map((note) => { + return ( +
+ help:{" "} + {note} +
+ ) + })}
- ) - })} - - ) + )} +
+ ) + }) } function ErrorPanel({ errors }: { errors: Marker[] }) {