Skip to content

Commit 7c08ade

Browse files
authored
syntax: fill out more of the ast (#658)
1 parent a8afe5f commit 7c08ade

File tree

2 files changed

+187
-9
lines changed

2 files changed

+187
-9
lines changed

crates/squawk_syntax/src/ast/generated/nodes.rs

Lines changed: 168 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/squawk_syntax/src/postgresql.ungram

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ LikeClause =
499499
'like'
500500

501501
WhereClause =
502-
'where'
502+
'where' Expr
503503

504504
GroupByClause =
505505
'group' 'by' ('all' | 'distinct') (GroupingRollup | GroupingCube | GroupingSets | GroupingExpr)
@@ -539,7 +539,7 @@ DistinctClause =
539539

540540
Target =
541541
'*'
542-
| Expr
542+
| (Expr ('as' Name)?)
543543

544544
TargetList =
545545
Target (',' Target)*
@@ -567,13 +567,13 @@ UsingClause =
567567
'using'
568568

569569
Alias =
570-
'as'?
570+
'as'? ColumnList?
571571

572572
SequenceOptionList =
573573
'(' ')'
574574

575575
ColumnList =
576-
'(' ')'
576+
'(' (Column (',' Column)*) ')'
577577

578578
ConstraintIncludeClause =
579579
'include'
@@ -613,7 +613,7 @@ JoinUsingClause =
613613
'using' ColumnList Alias?
614614

615615
Join =
616-
'natural'? JoinType (using_clause:JoinUsingClause | OnClause)?
616+
'natural'? JoinType FromItem (using_clause:JoinUsingClause | OnClause)?
617617

618618
JoinExpr =
619619
(FromItem | JoinExpr) Join
@@ -625,6 +625,7 @@ ParenSelect =
625625
')'
626626

627627
Select =
628+
WithClause?
628629
SelectClause
629630
FromClause?
630631
WhereClause?
@@ -1036,8 +1037,16 @@ Materialized =
10361037
NotMaterialized =
10371038
'not' 'materialized'
10381039

1040+
WithQuery =
1041+
Select
1042+
| Values
1043+
| Insert
1044+
| Update
1045+
| Delete
1046+
| Merge
1047+
10391048
WithTable =
1040-
'with' (Materialized | NotMaterialized)?
1049+
Name ColumnList? 'as'? (Materialized | NotMaterialized)? '(' query:WithQuery ')'
10411050

10421051
WithClause =
10431052
'with' 'recursive'? (WithTable (',' WithTable)*)
@@ -1092,7 +1101,10 @@ OrderByClause =
10921101
'order' 'by' (SortBy (',' SortBy)*)
10931102

10941103
FromItem =
1095-
'only'? NameRef
1104+
'only'? NameRef Alias?
1105+
| 'lateral'? ParenSelect Alias?
1106+
| 'lateral'? CallExpr Alias?
1107+
| 'lateral'? 'rows' 'from' '(' CallExpr ')' Alias?
10961108

10971109
FromClause =
10981110
'from'

0 commit comments

Comments
 (0)