Skip to content

Commit fd7706d

Browse files
fix(Lezer grammar): Pipelines require paranthesis (#5194)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 283621d commit fd7706d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

grammars/prql-lezer/src/prql.grammar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Module { kw<"module"> Identifier "{" statements "}" }
2424

2525
pipelineStatement { Pipeline (~ambigNewline newline+ | end)}
2626

27-
Pipeline { CallExpression (pipe CallExpression)* }
27+
Pipeline { CallExpression (pipe CallExpression)* | expression "|" Identifier }
2828

2929
pipe { "|" | ~ambigNewline newline+ }
3030

grammars/prql-lezer/test/misc.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,13 @@ module foo {
187187
==>
188188

189189
Query(Module(module,Identifier,VariableDeclaration(let,VariableName,Equals,Lambda(SString))))
190+
191+
# Pipeline within tuple
192+
193+
derive {
194+
a = (b | math.abs)
195+
}
196+
197+
==>
198+
199+
Query(Pipeline(CallExpression(Identifier,ArgList(TupleExpression(DeclarationTuple(DeclarationItem,Equals,NestedPipeline(Pipeline(Identifier,Identifier))))))))

0 commit comments

Comments
 (0)