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:
parent
597a25da80
commit
fde2c31a81
|
|
@ -34,6 +34,7 @@
|
||||||
"-"[@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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user