From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-commits+bounces-349068-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1QRk9D-0008Vb-Q4
	for garchives@archives.gentoo.org; Wed, 01 Jun 2011 12:03:40 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1060E1C064;
	Wed,  1 Jun 2011 12:03:12 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id D58F01C04C
	for <gentoo-commits@lists.gentoo.org>; Wed,  1 Jun 2011 12:03:12 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 627CC1B400E
	for <gentoo-commits@lists.gentoo.org>; Wed,  1 Jun 2011 12:03:12 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 57A868050E
	for <gentoo-commits@lists.gentoo.org>; Wed,  1 Jun 2011 12:03:11 +0000 (UTC)
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" <betelgeuse@gentoo.org>
Message-ID: <bf0e206d28d3cd9f5de4d63700a06c75d9581e23.betelgeuse@gentoo>
Subject: [gentoo-commits] proj/libbash:master commit in: bashast/, bashast/gunit/
X-VCS-Repository: proj/libbash
X-VCS-Files: bashast/bashast.g bashast/gunit/arith_main.gunit
X-VCS-Directories: bashast/ bashast/gunit/
X-VCS-Committer: betelgeuse
X-VCS-Committer-Name: Petteri Räty
X-VCS-Revision: bf0e206d28d3cd9f5de4d63700a06c75d9581e23
Date: Wed,  1 Jun 2011 12:03:11 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: ae2d268c87d258804a1c998d5afdcb98

commit:     bf0e206d28d3cd9f5de4d63700a06c75d9581e23
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Mon May 30 08:30:18 2011 +0000
Commit:     Petteri R=C3=A4ty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Wed Jun  1 06:11:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a=
=3Dcommit;h=3Dbf0e206d

Parser: allow spaces at the end of arithmetic expansion

---
 bashast/bashast.g              |    4 ++--
 bashast/gunit/arith_main.gunit |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bashast/bashast.g b/bashast/bashast.g
index 26d362f..c560644 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -554,8 +554,8 @@ explicit_arithmetic
 //the square bracket from is deprecated
 //http://permalink.gmane.org/gmane.comp.shells.bash.bugs/14479
 arithmetic_expansion
-	:	DOLLAR LLPAREN BLANK* arithmetics RRPAREN -> ^(ARITHMETIC_EXPRESSION =
arithmetics)
-	|	DOLLAR LSQUARE BLANK* arithmetics RSQUARE -> ^(ARITHMETIC_EXPRESSION =
arithmetics);
+	:	DOLLAR LLPAREN BLANK* arithmetics BLANK* RRPAREN -> ^(ARITHMETIC_EXPR=
ESSION arithmetics)
+	|	DOLLAR LSQUARE BLANK* arithmetics BLANK* RSQUARE -> ^(ARITHMETIC_EXPR=
ESSION arithmetics);
=20
 process_substitution
 	:	(dir=3DLESS_THAN|dir=3DGREATER_THAN)LPAREN clist BLANK* RPAREN -> ^(P=
ROCESS_SUBSTITUTION $dir clist);

diff --git a/bashast/gunit/arith_main.gunit b/bashast/gunit/arith_main.gu=
nit
index 4490eb3..b462450 100644
--- a/bashast/gunit/arith_main.gunit
+++ b/bashast/gunit/arith_main.gunit
@@ -134,4 +134,5 @@ arithmetic_expansion:
 start:
 "echo $(( 3 + 2 ))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_=
EXPRESSION (+ 3 2)))))
 "echo $((++i))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EXPR=
ESSION (PRE_INCR (VAR_REF i))))))
+"echo $(( ++i ))" -> (LIST (COMMAND (STRING echo) (STRING (ARITHMETIC_EX=
PRESSION (PRE_INCR (VAR_REF i))))))
 "echo \"The solution is: $(( 3+2 ))\""-> (LIST (COMMAND (STRING echo) (S=
TRING (DOUBLE_QUOTED_STRING The   solution   is :   (ARITHMETIC_EXPRESSIO=
N (+ 3 2))))))