Skip to content

Commit 1aca32b

Browse files
authored
parser: rename column functions to make refs/names more clear (#803)
1 parent 58f2d34 commit 1aca32b

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

crates/squawk_parser/src/grammar.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3433,7 +3433,7 @@ fn join_using_clause(p: &mut Parser<'_>) {
34333433
let m = p.start();
34343434
// USING ( join_column [, ...] )
34353435
p.expect(USING_KW);
3436-
column_list(p);
3436+
column_ref_list(p);
34373437
opt_alias(p);
34383438
m.complete(p, JOIN_USING_CLAUSE);
34393439
}
@@ -3643,12 +3643,12 @@ fn column(p: &mut Parser<'_>, kind: &ColumnDefKind) -> CompletedMarker {
36433643
}
36443644

36453645
// [ ( column_name [, ... ] ) ]
3646-
fn opt_column_list(p: &mut Parser<'_>) -> bool {
3646+
fn opt_column_ref_list(p: &mut Parser<'_>) -> bool {
36473647
opt_column_list_with(p, ColumnDefKind::NameRef)
36483648
}
36493649

3650-
fn column_list(p: &mut Parser<'_>) {
3651-
if !opt_column_list(p) {
3650+
fn column_ref_list(p: &mut Parser<'_>) {
3651+
if !opt_column_ref_list(p) {
36523652
p.error("expected column list");
36533653
}
36543654
}
@@ -3657,7 +3657,7 @@ fn opt_include_columns(p: &mut Parser<'_>) -> Option<CompletedMarker> {
36573657
if p.at(INCLUDE_KW) {
36583658
let m = p.start();
36593659
p.bump(INCLUDE_KW);
3660-
column_list(p);
3660+
column_ref_list(p);
36613661
Some(m.complete(p, CONSTRAINT_INCLUDE_CLAUSE))
36623662
} else {
36633663
None
@@ -3711,14 +3711,14 @@ fn referential_action(p: &mut Parser<'_>) {
37113711
let m = p.start();
37123712
p.expect(SET_KW);
37133713
p.expect(NULL_KW);
3714-
opt_column_list(p);
3714+
opt_column_ref_list(p);
37153715
m.complete(p, SET_NULL_COLUMNS);
37163716
}
37173717
SET_KW => {
37183718
let m = p.start();
37193719
p.bump(SET_KW);
37203720
p.expect(DEFAULT_KW);
3721-
opt_column_list(p);
3721+
opt_column_ref_list(p);
37223722
m.complete(p, SET_DEFAULT_COLUMNS);
37233723
}
37243724
_ => {
@@ -4111,7 +4111,7 @@ fn table_constraint(p: &mut Parser<'_>) -> CompletedMarker {
41114111
// [ NULLS [ NOT ] DISTINCT ] ( column_name [, ... ] ) index_parameters
41124112
} else {
41134113
opt_nulls_not_distinct(p);
4114-
column_list(p);
4114+
column_ref_list(p);
41154115
opt_index_parameters(p);
41164116
}
41174117
UNIQUE_CONSTRAINT
@@ -4126,7 +4126,7 @@ fn table_constraint(p: &mut Parser<'_>) -> CompletedMarker {
41264126
using_index(p);
41274127
// ( column_name [, ... ] ) index_parameters
41284128
} else {
4129-
column_list(p);
4129+
column_ref_list(p);
41304130
opt_index_parameters(p);
41314131
}
41324132
PRIMARY_KEY_CONSTRAINT
@@ -4152,10 +4152,10 @@ fn table_constraint(p: &mut Parser<'_>) -> CompletedMarker {
41524152
// must be in a foreign key constraint
41534153
p.expect(FOREIGN_KW);
41544154
p.expect(KEY_KW);
4155-
column_list(p);
4155+
column_ref_list(p);
41564156
p.expect(REFERENCES_KW);
41574157
path_name_ref(p);
4158-
opt_column_list(p);
4158+
opt_column_ref_list(p);
41594159
opt_match_type(p);
41604160
opt_foreign_key_actions(p);
41614161
FOREIGN_KEY_CONSTRAINT
@@ -9105,7 +9105,7 @@ fn publication_object(p: &mut Parser<'_>) {
91059105
path_name_ref(p);
91069106
}
91079107
p.eat(STAR);
9108-
opt_column_list(p);
9108+
opt_column_ref_list(p);
91099109
opt_constraint_where_clause(p);
91109110
}
91119111
m.complete(p, PUBLICATION_OBJECT);
@@ -10532,7 +10532,7 @@ fn merge_action(p: &mut Parser<'_>) {
1053210532
INSERT_KW => {
1053310533
p.bump(INSERT_KW);
1053410534
// [ ( column_name [, ...] ) ]
10535-
opt_column_list(p);
10535+
opt_column_ref_list(p);
1053610536
// [ OVERRIDING { SYSTEM | USER } VALUE ]
1053710537
if p.eat(OVERRIDING_KW) {
1053810538
if !p.eat(SYSTEM_KW) && !p.eat(USER_KW) {
@@ -10614,7 +10614,7 @@ fn grant(p: &mut Parser<'_>) -> CompletedMarker {
1061410614
// ALL [ PRIVILEGES ]
1061510615
if p.eat(ALL_KW) {
1061610616
p.eat(PRIVILEGES_KW);
10617-
opt_column_list(p);
10617+
opt_column_ref_list(p);
1061810618
} else if !p.at(TO_KW) {
1061910619
revoke_command_list(p);
1062010620
}
@@ -10815,7 +10815,7 @@ fn privileges(p: &mut Parser<'_>) {
1081510815
revoke_command_list(p);
1081610816
}
1081710817
// [ ( column_name [, ...] ) ]
10818-
opt_column_list(p);
10818+
opt_column_ref_list(p);
1081910819
m.complete(p, PRIVILEGES);
1082010820
}
1082110821

@@ -10848,7 +10848,7 @@ fn revoke_command(p: &mut Parser<'_>) {
1084810848
}
1084910849
}
1085010850
// [ ( column_name [, ...] ) ]
10851-
opt_column_list(p);
10851+
opt_column_ref_list(p);
1085210852
m.complete(p, REVOKE_COMMAND);
1085310853
}
1085410854

@@ -11694,7 +11694,7 @@ fn opt_table_and_columns(p: &mut Parser<'_>) -> bool {
1169411694
m.abandon(p);
1169511695
return false;
1169611696
}
11697-
opt_column_list(p);
11697+
opt_column_ref_list(p);
1169811698
m.complete(p, TABLE_AND_COLUMNS);
1169911699
true
1170011700
}
@@ -11918,7 +11918,7 @@ fn copy(p: &mut Parser<'_>) -> CompletedMarker {
1191811918
// table_name
1191911919
path_name_ref(p);
1192011920
// [ ( column_name [, ...] ) ]
11921-
opt_column_list(p);
11921+
opt_column_ref_list(p);
1192211922
}
1192311923
if p.eat(FROM_KW) {
1192411924
// STDIN
@@ -12296,7 +12296,7 @@ fn insert(p: &mut Parser<'_>, m: Option<Marker>) -> CompletedMarker {
1229612296
path_name_ref(p);
1229712297
opt_as_alias_with_as(p);
1229812298
// [ ( column_name [, ...] ) ]
12299-
opt_column_list(p);
12299+
opt_column_ref_list(p);
1230012300
// [ OVERRIDING { SYSTEM | USER } VALUE ]
1230112301
if p.eat(OVERRIDING_KW) {
1230212302
let _ = p.eat(SYSTEM_KW) || p.expect(USER_KW);
@@ -12443,7 +12443,7 @@ fn opt_set_column(p: &mut Parser<'_>) -> Option<CompletedMarker> {
1244312443
// ( column_name [, ...] ) = [ ROW ] ( { expression | DEFAULT } [, ...] ) |
1244412444
// ( column_name [, ...] ) = ( sub-SELECT )
1244512445
if p.at(L_PAREN) {
12446-
column_list(p);
12446+
column_ref_list(p);
1244712447
p.expect(EQ);
1244812448
set_expr_list_or_paren_select(p);
1244912449
Some(m.complete(p, SET_MULTIPLE_COLUMNS))

0 commit comments

Comments
 (0)