Skip to content

Commit b436543

Browse files
authored
change(tree-sitter module): remove select_limit (#18)
1 parent 4a72a3b commit b436543

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

  • crates/postgresql-cst-parser/src/tree_sitter

crates/postgresql-cst-parser/src/tree_sitter/convert.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ fn walk_and_build(
193193
| SyntaxKind::select_clause
194194
| SyntaxKind::opt_select_limit
195195
| SyntaxKind::opt_target_list
196-
| SyntaxKind::opt_sort_clause => {
196+
| SyntaxKind::opt_sort_clause
197+
| SyntaxKind::select_limit => {
197198
// [Node: Removal]
198199
//
199200
// Ignore current node, and continue building its children.
@@ -301,6 +302,16 @@ FROM
301302
let (new_root, _) = get_ts_tree_and_range_map(input, &root);
302303
assert_not_exists(&new_root, SyntaxKind::opt_sort_clause);
303304
}
305+
306+
#[test]
307+
fn no_select_limit() {
308+
let input = "select a from t limit 5;";
309+
let root = cst::parse(input).unwrap();
310+
assert_exists(&root, SyntaxKind::select_limit);
311+
312+
let (new_root, _) = get_ts_tree_and_range_map(input, &root);
313+
assert_not_exists(&new_root, SyntaxKind::select_limit);
314+
}
304315
}
305316

306317
mod flatten {

0 commit comments

Comments
 (0)