feat(parser): add pipe token to grammar

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 <noreply@anthropic.com>
This commit is contained in:
Corey Johnson 2025-10-12 16:31:02 -07:00
parent 597a25da80
commit fde2c31a81

View File

@ -33,7 +33,8 @@
"+"[@name=operator] "+"[@name=operator]
"-"[@name=operator] "-"[@name=operator]
"*"[@name=operator] "*"[@name=operator]
"/"[@name=operator] "/"[@name=operator]
"|"[@name=operator]
} }
@external tokens tokenizer from "./tokenizer" { Identifier, Word } @external tokens tokenizer from "./tokenizer" { Identifier, Word }
@ -77,11 +78,11 @@ arg {
} }
PositionalArg { PositionalArg {
expression expression | FunctionDef
} }
NamedArg { NamedArg {
NamedArgPrefix expression NamedArgPrefix (expression | FunctionDef)
} }
FunctionDef { FunctionDef {
@ -89,7 +90,7 @@ FunctionDef {
} }
singleLineFunctionDef { singleLineFunctionDef {
"fn" Params colon consumeToTerminator "fn" Params colon consumeToTerminator end
} }
multilineFunctionDef { multilineFunctionDef {