Gentoo Archives: gentoo-commits

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/libbash:master commit in: bashast/, bashast/gunit/
Date: Sat, 09 Apr 2011 06:28:12
Message-Id: 77260f935ead93c3ca7ca618841e87cffb321037.betelgeuse@gentoo
1 commit: 77260f935ead93c3ca7ca618841e87cffb321037
2 Author: Petteri Räty <petsku <AT> petteriraty <DOT> eu>
3 AuthorDate: Fri Apr 8 19:10:52 2011 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 9 06:13:53 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=77260f93
7
8 Remove warning from arithmetic_part
9
10 There's no need to list both alternatives as the first choice falls
11 through to the second any way.
12
13 ---
14 bashast/bashast.g | 3 +--
15 bashast/gunit/arith_main.gunit | 4 ++--
16 2 files changed, 3 insertions(+), 4 deletions(-)
17
18 diff --git a/bashast/bashast.g b/bashast/bashast.g
19 index ec04917..64568c9 100644
20 --- a/bashast/bashast.g
21 +++ b/bashast/bashast.g
22 @@ -441,8 +441,7 @@ extended_pattern_match
23 arithmetic_expansion
24 : DOLLAR LLPAREN BLANK* arithmetic_part BLANK* RRPAREN -> ^(ARITHMETIC_EXPRESSION arithmetic_part);
25 arithmetic_part
26 - : arithmetics
27 - | arithmetic;
28 + : arithmetics;
29 //The comma operator for arithmetic expansions
30 arithmetics
31 : arithmetic (BLANK!* COMMA! BLANK!* arithmetic)*;
32
33 diff --git a/bashast/gunit/arith_main.gunit b/bashast/gunit/arith_main.gunit
34 index 9010822..5a29849 100644
35 --- a/bashast/gunit/arith_main.gunit
36 +++ b/bashast/gunit/arith_main.gunit
37 @@ -117,8 +117,8 @@ arithmetic_condition:
38 "5?7:2"->(ARITHMETIC_CONDITION 5 7 2)
39 "(4-3)?0:1"->(ARITHMETIC_CONDITION (- 4 3) 0 1)
40
41 -arithmetics:
42 -"5+4, 3+2, $a*$b" -> (+ 5 4) (+ 3 2) (* (VAR_REF a) (VAR_REF b))
43 +arithmetic_expansion:
44 +"$((5+4, 3+2, $a*$b))" -> (ARITHMETIC_EXPRESSION (+ 5 4) (+ 3 2) (* (VAR_REF a) (VAR_REF b)))
45
46 start:
47 "echo $(( 3 + 2 ))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPRESSION (+ 3 2)))))