From 6da00dd3c8618ba4de8802b184ce08ff215143f1 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Tue, 25 Nov 2025 16:53:17 -0800 Subject: [PATCH] pipes end expressions --- src/parser/parser2.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parser/parser2.ts b/src/parser/parser2.ts index 6244038..862f4b9 100644 --- a/src/parser/parser2.ts +++ b/src/parser/parser2.ts @@ -123,7 +123,7 @@ export class Parser { // check for parens function call // ex: (ref my-func) my-arg - if (expr.type.is('ParenExpr') && !this.isExprEnd() && !this.is($T.Operator, '|')) + if (expr.type.is('ParenExpr') && !this.isExprEnd()) expr = this.functionCall(expr) // if dotget is followed by binary operator, continue parsing as binary expression @@ -588,7 +588,7 @@ export class Parser { const ident = fn ?? this.identifier() const args: SyntaxNode[] = [] - while (!this.isExprEnd() && !this.is($T.Operator, '|')) + while (!this.isExprEnd()) args.push(this.is($T.NamedArgPrefix) ? this.namedArg() : this.arg()) const node = new SyntaxNode('FunctionCall', ident.from, (args.at(-1) || ident).to) @@ -869,6 +869,7 @@ export class Parser { isExprEnd(): boolean { return this.isAny($T.Colon, $T.Semicolon, $T.Newline, $T.CloseParen, $T.CloseBracket) || + this.is($T.Operator, '|') || this.isExprEndKeyword() || !this.current() }