diff options
author | Nathan Eloe <powerofazure@gmail.com> | 2010-07-27 13:10:40 -0500 |
---|---|---|
committer | Nathan Eloe <powerofazure@gmail.com> | 2010-08-01 12:03:02 -0500 |
commit | f4401cb676de923ce40d5c70d51564aa7d0f956c (patch) | |
tree | a917ad2f706309558c3ecf759cfa40248feb0b43 /bashast/gunit/arith_main.gunit | |
parent | Support for continued lines (diff) | |
download | libbash-f4401cb676de923ce40d5c70d51564aa7d0f956c.tar.gz libbash-f4401cb676de923ce40d5c70d51564aa7d0f956c.tar.bz2 libbash-f4401cb676de923ce40d5c70d51564aa7d0f956c.zip |
Bug fix: arithmetic expansion missing features
Adds support for the following arithmetic constructs:
Arithmetic assignment, arithmetic conditionals, and the comma operator.
Diffstat (limited to 'bashast/gunit/arith_main.gunit')
-rw-r--r-- | bashast/gunit/arith_main.gunit | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bashast/gunit/arith_main.gunit b/bashast/gunit/arith_main.gunit index 8f5ac65..c8c4b25 100644 --- a/bashast/gunit/arith_main.gunit +++ b/bashast/gunit/arith_main.gunit @@ -93,3 +93,15 @@ logicand: logicor: "17" -> "17" "17 || 15" -> (|| 17 15) + +arithmetic_assignment: +"13"->"13" +"foo=5+3" -> (= foo (+ 5 3)) +"asdf += 5" -> (+= asdf 5) + +arithmetic_condition: +"5?7:2"->(ARITHMETIC_CONDITION 5 7 2) +"(4-3)?0:1"->(ARITHMETIC_CONDITION (- 4 3) 0 1) + +arithmetics: +"5+4, 3+2, $a*$b" -> (+ 5 4) (+ 3 2) (* (VAR_REF a) (VAR_REF b)) |