Skip to content

Commit c6bbb93

Browse files
Mhttp://127.0.0.1:3001erge branch 'refactor/parser' of https://github.com/supabase-community/postgres_lsp into refactor/parser
2 parents f4129e0 + ce94b59 commit c6bbb93

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

crates/pgt_statement_splitter/src/parser.rs

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ impl Parser {
134134
.find(|t| is_relevant(t))
135135
}
136136

137+
/// Returns `None` if there are no previous relevant tokens
137138
fn look_back(&self) -> Option<&Token> {
138139
self.find_last_relevant().map(|it| it.1)
139140
}

crates/pgt_statement_splitter/src/parser/common.rs

+6
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ pub(crate) fn unknown(p: &mut Parser, exclude: &[SyntaxKind]) {
145145
SyntaxKind::Also,
146146
// for create rule
147147
SyntaxKind::Instead,
148+
// for UNION
149+
SyntaxKind::Union,
150+
// for UNION ALL
151+
SyntaxKind::All,
152+
// for UNION ... EXCEPT
153+
SyntaxKind::Except,
148154
]
149155
.iter()
150156
.all(|x| Some(x) != prev.as_ref())
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
select 1 union all select 2;
2+
3+
select 1 union select 2;
4+
5+
select 1 union select 2 except select 3;
6+
7+
select 1 union all select 2 except select 3;

0 commit comments

Comments
 (0)