From fde2c31a812e7a706c072964b2084026a0bf364c Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Sun, 12 Oct 2025 16:31:02 -0700 Subject: [PATCH] feat(parser): add pipe token to grammar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add "|" token to @tokens section to support pipe operator. This is the first step in implementing Unix-style pipe expressions for chaining function calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/parser/shrimp.grammar | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/parser/shrimp.grammar b/src/parser/shrimp.grammar index b51dfda..a620820 100644 --- a/src/parser/shrimp.grammar +++ b/src/parser/shrimp.grammar @@ -33,7 +33,8 @@ "+"[@name=operator] "-"[@name=operator] "*"[@name=operator] - "/"[@name=operator] + "/"[@name=operator] + "|"[@name=operator] } @external tokens tokenizer from "./tokenizer" { Identifier, Word } @@ -77,11 +78,11 @@ arg { } PositionalArg { - expression + expression | FunctionDef } NamedArg { - NamedArgPrefix expression + NamedArgPrefix (expression | FunctionDef) } FunctionDef { @@ -89,7 +90,7 @@ FunctionDef { } singleLineFunctionDef { - "fn" Params colon consumeToTerminator + "fn" Params colon consumeToTerminator end } multilineFunctionDef {