Open pkoppstein opened 5 months ago
Using jaq.jq below:
$ jq -n -f jaq.jq 1 2 $ goq -n -f jaq.jq 1 2 $ jaq -n -f jaq.jq Error: Unexpected token while parsing definition, expected [, if, try, {, .., -, ., (, " ╭─[<unknown>:5:5] │ 5 │ | def a: 2 * $s; │ ──┬─ │ ╰─── Unexpected token def ───╯
jaq.jq
def example: . as $s | def a: 2 * $s; ($s, a); 1 | example
Thanks a lot for reporting this, @pkoppstein! I was not aware that definitions were allowed at such positions. Supporting this will require a breaking change to the syntax, so my plan is to support this for 2.0.
Using jaq.jq below:
jaq.jq