diff --git a/crates/postgresql-cst-parser/src/tree_sitter/convert.rs b/crates/postgresql-cst-parser/src/tree_sitter/convert.rs index bbacc72..bf5a1e5 100644 --- a/crates/postgresql-cst-parser/src/tree_sitter/convert.rs +++ b/crates/postgresql-cst-parser/src/tree_sitter/convert.rs @@ -144,6 +144,7 @@ fn walk_and_build( | SyntaxKind::expr_list | SyntaxKind::func_arg_list | SyntaxKind::when_clause_list + | SyntaxKind::group_by_list | SyntaxKind::sortby_list) => { if parent_kind == child_kind { // [Node: Flatten] @@ -363,5 +364,14 @@ FROM assert_no_direct_nested_kind(&new_root, SyntaxKind::sortby_list); } + + #[test] + fn no_nested_groupby_list() { + let input = "select a, b, c from t group by a, b, c;"; + let root = cst::parse(input).unwrap(); + let (new_root, _) = get_ts_tree_and_range_map(&input, &root); + + assert_no_direct_nested_kind(&new_root, SyntaxKind::group_by_list); + } } }