Skip to content

Commit 6d8fb36

Browse files
authored
parser: parse non standard placeholders like :name (#560)
1 parent 9a7eac7 commit 6d8fb36

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

crates/squawk_parser/src/generated/syntax_kind.rs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/squawk_parser/src/grammar.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,11 @@ fn lhs(p: &mut Parser<'_>, r: &Restrictions) -> Option<CompletedMarker> {
12541254
p.bump_any();
12551255
(PREFIX_EXPR, 13)
12561256
}
1257+
COLON => {
1258+
m = p.start();
1259+
p.bump(COLON);
1260+
(NON_STANDARD_PARAM, 7)
1261+
}
12571262
_ if p.at_ts(OPERATOR_FIRST) && p.at(CUSTOM_OP) => {
12581263
m = p.start();
12591264
p.bump(CUSTOM_OP);

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

Lines changed: 33 additions & 0 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,9 @@ PrefixExpr =
928928
PostfixExpr =
929929
Expr
930930

931+
NonStandardParam =
932+
':' NameRef
933+
931934
IndexExpr =
932935
base:Expr '[' index:Expr ']'
933936

0 commit comments

Comments
 (0)