Skip to content

Commit 7142a12

Browse files
lu-zeroshssoichiro
authored andcommitted
fix!: Consider WITH a top level reserved word
1 parent e205542 commit 7142a12

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,8 @@ mod tests {
19911991
};
19921992
let expected = indoc! {
19931993
"
1994-
WITH a AS (
1994+
WITH
1995+
a AS (
19951996
SELECT a, b, c
19961997
FROM t
19971998
WHERE a > 100

src/tokenizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ fn get_top_level_reserved_token_no_indent<'i>(input: &mut &'i str) -> PResult<To
594594
terminated("MINUS", end_of_word),
595595
terminated("UNION", end_of_word),
596596
terminated("UNION ALL", end_of_word),
597+
terminated("WITH", end_of_word),
597598
terminated("$$", end_of_word),
598599
))
599600
.parse_next(&mut uc_input);
@@ -987,7 +988,6 @@ fn get_plain_reserved_one_token<'i>(input: &mut &'i str) -> PResult<Token<'i>> {
987988

988989
'W' => alt((
989990
terminated("WHEN", end_of_word),
990-
terminated("WITH", end_of_word),
991991
terminated("WORK", end_of_word),
992992
terminated("WRITE", end_of_word),
993993
))

0 commit comments

Comments
 (0)