Skip to content

Commit 13a4f5e

Browse files
committed
feat: flatten TableFuncElementList
1 parent eeb064f commit 13a4f5e

File tree

1 file changed

+11
-1
lines changed
  • crates/postgresql-cst-parser/src/tree_sitter

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ fn walk_and_build(
154154
| SyntaxKind::set_target_list
155155
| SyntaxKind::insert_column_list
156156
| SyntaxKind::index_params
157-
| SyntaxKind::values_clause) => {
157+
| SyntaxKind::values_clause
158+
| SyntaxKind::TableFuncElementList) => {
158159
if parent_kind == child_kind {
159160
// [Node: Flatten]
160161
//
@@ -495,5 +496,14 @@ FROM
495496

496497
assert_no_direct_nested_kind(&new_root, SyntaxKind::values_clause);
497498
}
499+
500+
#[test]
501+
fn no_nested_table_func_element_list() {
502+
let input = "select * from unnest(a) as (x int, y text);";
503+
let root = cst::parse(input).unwrap();
504+
let (new_root, _) = get_ts_tree_and_range_map(input, &root);
505+
506+
assert_no_direct_nested_kind(&new_root, SyntaxKind::TableFuncElementList);
507+
}
498508
}
499509
}

0 commit comments

Comments
 (0)