From 63d10433c9e92028d5b6acda47119bde998eae1f Mon Sep 17 00:00:00 2001 From: Stephen Dolan Date: Sun, 2 Dec 2012 22:22:08 +0000 Subject: [PATCH] Fix a horrible scoping/associativity bug. `1 as $x | . | $x` didn't compile, as it was parsed as (1 as $x | .) | $x where `$x` is undefined, rather than as 1 as $x | (. | $x) --- parser.y | 2 +- testdata | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/parser.y b/parser.y index 59d535e..9c23450 100644 --- a/parser.y +++ b/parser.y @@ -75,7 +75,7 @@ struct lexer_param; /* revolting hack */ %left ';' -%left '|' +%right '|' %left ',' %right "//" %nonassoc '=' SETPIPE SETPLUS SETMINUS SETMULT SETDIV SETDEFINEDOR diff --git a/testdata b/testdata index 1bab84f..e6fcaaf 100644 --- a/testdata +++ b/testdata @@ -146,6 +146,10 @@ null [6] [7] +42 as $x | . | . | . + 432 | $x + 1 +34324 +43 + 1 as $x | [$x,$x,$x as $x | $x] null [1,1,1] -- 2.40.0