aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-arith/arith.right (follow)
Commit message (Collapse)AuthorAgeFilesLines
* shell/math: bash-compatible handling of too large numbersDenys Vlasenko2023-06-251-1/+2
| | | | | | | | | | function old new delta parse_with_base - 170 +170 evaluate_string 1477 1309 -168 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 170/-168) Total: 2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell/math: fix parsing of ?: and explain why it's parsed that wayDenys Vlasenko2023-06-151-1/+1
| | | | | | | | | | | | | | | | | 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 <vda.linux@googlemail.com>
* shell: enable more tests which are passing nowDenys Vlasenko2021-09-251-17/+41
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: fix arithmentic evaluation of "++7" and such (it is + + 7, i.e. 7)Denys Vlasenko2021-09-251-7/+13
| | | | | | | function old new delta evaluate_string 945 988 +43 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell: handle $((NUM++...) like bash does. Closes 10706Denys Vlasenko2018-01-281-0/+4
| | | | | | | function old new delta evaluate_string 680 729 +49 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shell/math: deconvolute and explain ?: handling. Give better error messageDenys Vlasenko2010-09-161-1/+1
| | | | | | | function old new delta arith_apply 1271 1283 +12 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* shell/math: return string error indicator, not integerDenys Vlasenko2010-09-151-28/+28
| | | | | | | | | | | | | | | | function old new delta expand_and_evaluate_arith 87 106 +19 expand_one_var 1563 1570 +7 arith 12 18 +6 evaluate_string 678 680 +2 arith_apply 1269 1271 +2 builtin_umask 133 132 -1 ash_arith 118 75 -43 expand_vars_to_list 1094 1038 -56 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/3 up/down: 36/-100) Total: -64 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* small ash testsuite, adapted from bashDenis Vlasenko2007-03-051-0/+138
(only a small part of it, actually)