From 5f56a0388271d2de6cf31af1041bdcb3d11029fc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 15 Jun 2023 10:07:12 +0200 Subject: shell/math: fix parsing of ?: and explain why it's parsed that way This fixes arith-precedence1.tests. This breaks arith-ternary2.tests again (we now evaluate variables on not-taken branches). We need a better logic here anyway: not only bare variables should not evaluate when not-taken: 1 ? eval_me : do_not_eval but any (arbitrarily complex) expressions shouldn't evaluate as well! 1 ? var_is_set=1 : ((var_is_not_set=2,var2*=4)) function old new delta evaluate_string 1097 1148 +51 Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-arith/arith-ternary2.right | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 shell/hush_test/hush-arith/arith-ternary2.right (limited to 'shell/hush_test/hush-arith/arith-ternary2.right') diff --git a/shell/hush_test/hush-arith/arith-ternary2.right b/shell/hush_test/hush-arith/arith-ternary2.right deleted file mode 100644 index a549b1b..0000000 --- a/shell/hush_test/hush-arith/arith-ternary2.right +++ /dev/null @@ -1,3 +0,0 @@ -6:6 -a=b=+err+ -b=6 -- cgit v1.1