Skip to content

Commit 759b67d

Browse files
author
Dairyo Sekine
committed
fix types
1 parent f7d48b9 commit 759b67d

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

src/cst.rs

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub enum NodeType {
6767
ForSystemTimeAsOfClause, // FOR SYSTEM_TIME AS OF ts
6868
ForStatement,
6969
GrantStatement,
70+
GroupByExprs,
7071
GroupedIdentWithOptions, // (col OPTIONS())
7172
GroupedExpr, // (1)
7273
GroupedExprs, // (1, 2, 3)

src/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ impl Parser {
16681668
// GROUP BY
16691669
if self.get_token(1)?.is("GROUP") {
16701670
self.next_token()?; // expr -> GROUP
1671-
let mut groupby = self.construct_node(NodeType::XXXByExprs)?;
1671+
let mut groupby = self.construct_node(NodeType::GroupByExprs)?;
16721672
self.next_token()?; // GROUP -> BY
16731673
groupby.push_node("by", self.construct_node(NodeType::Keyword)?);
16741674
if self.get_token(1)?.in_(&vec!["ROLLUP", "CUBE"]) {

src/parser/tests/tests_select.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,7 @@ from:
20512051
expr:
20522052
self: t (Identifier)
20532053
groupby:
2054-
self: GROUP (XXXByExprs)
2054+
self: GROUP (GroupByExprs)
20552055
by:
20562056
self: BY (Keyword)
20572057
exprs:
@@ -2084,7 +2084,7 @@ from:
20842084
expr:
20852085
self: t (Identifier)
20862086
groupby:
2087-
self: GROUP (XXXByExprs)
2087+
self: GROUP (GroupByExprs)
20882088
by:
20892089
self: BY (Keyword)
20902090
exprs:
@@ -2118,7 +2118,7 @@ from:
21182118
expr:
21192119
self: t (Identifier)
21202120
groupby:
2121-
self: GROUP (XXXByExprs)
2121+
self: GROUP (GroupByExprs)
21222122
by:
21232123
self: BY (Keyword)
21242124
exprs:
@@ -2167,7 +2167,7 @@ from:
21672167
expr:
21682168
self: t (Identifier)
21692169
groupby:
2170-
self: GROUP (XXXByExprs)
2170+
self: GROUP (GroupByExprs)
21712171
by:
21722172
self: BY (Keyword)
21732173
exprs:

src/types.rs

+11
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export type UnknownNode =
5959
| ForStatement
6060
| ForSystemTimeAsOfClause
6161
| GrantStatement
62+
| GroupByExprs
6263
| GroupedExpr
6364
| GroupedExprs
6465
| GroupedIdentWithOptions
@@ -810,6 +811,16 @@ export type GrantStatement = XXXStatement & {
810811
};
811812
};
812813
814+
export type GroupByExprs = BaseNode & {
815+
token: Token;
816+
node_type: "GroupByExprs";
817+
children: {
818+
by: NodeChild;
819+
how?: NodeVecChild;
820+
exprs: { NodeVec: Expr[] & UnknownNode[] };
821+
};
822+
};
823+
813824
export type GroupedExpr = FromItemExpr & {
814825
node_type: "GroupedExpr";
815826
children: {

0 commit comments

Comments
 (0)