Skip to content

Commit d13c451

Browse files
committed
Simplify name_data_type parsing
1 parent b349053 commit d13c451

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/parser.pegjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7056,11 +7056,8 @@ named_data_type
70567056
/ &bigquery type:(bigquery_array_type / bigquery_struct_type / bigquery_table_type) {
70577057
return type;
70587058
}
7059-
/ kw:(type_name __) params:paren$list$expr {
7060-
return loc({ type: "named_data_type", name: read(kw), params });
7061-
}
7062-
/ kw:type_name {
7063-
return loc({ type: "named_data_type", name: kw });
7059+
/ kw:type_name params:(__ paren$list$expr)? {
7060+
return loc({ type: "named_data_type", name: read(kw), params: read(params) });
70647061
}
70657062

70667063
datetime_data_type

test/ddl/data_types.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ describe("data types", () => {
425425
],
426426
"type": "data_type_identifier",
427427
},
428+
"params": undefined,
428429
"type": "named_data_type",
429430
},
430431
"type": "cast_operator_expr",

0 commit comments

Comments
 (0)