Add support for trailing commas (#810)

* Add support for trailing commas

* Support trailing commas for brace/bracket

* Andrew's comments
This commit is contained in:
Ankur Goyal 2023-03-02 07:35:46 -08:00 committed by GitHub
parent 2285bb44ba
commit b45306819c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 65 additions and 23 deletions

View file

@ -181,6 +181,8 @@ fn parse_join_constraint_unnest_alias() {
fn parse_trailing_comma() {
for (sql, canonical) in [
("SELECT a,", "SELECT a"),
("SELECT 1,", "SELECT 1"),
("SELECT 1,2,", "SELECT 1, 2"),
("SELECT a, b,", "SELECT a, b"),
("SELECT a, b AS c,", "SELECT a, b AS c"),
("SELECT a, b AS c, FROM t", "SELECT a, b AS c FROM t"),