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 ) id 1QoyOo-0006EC-Ix for garchives@archives.gentoo.org; Thu, 04 Aug 2011 13:55:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE6C121C200; Thu, 4 Aug 2011 13:53:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id AE9A821C1EE for ; Thu, 4 Aug 2011 13:53:43 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6AD221B4016 for ; Thu, 4 Aug 2011 13:53:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C85A88004A for ; Thu, 4 Aug 2011 13:53:42 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: <5287ca8176926e7335feb4472fea6da28fb7fe76.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/array.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 5287ca8176926e7335feb4472fea6da28fb7fe76 Date: Thu, 4 Aug 2011 13:53:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: f678cd886eaccc4adfb8ea4e2b26d243 commit: 5287ca8176926e7335feb4472fea6da28fb7fe76 Author: Mu Qiao gentoo org> AuthorDate: Fri Jul 22 12:55:40 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Tue Aug 2 07:52:18 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D5287ca81 Parser: allow white spaces around array index --- bashast/bashast.g | 2 +- bashast/gunit/array.gunit | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 9c34478..a6b2e59 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -842,7 +842,7 @@ variable_name | POUND; =20 variable_name_no_digit - : name LSQUARE explicit_arithmetic RSQUARE -> ^(name explicit_arithmeti= c) + : name LSQUARE BLANK? explicit_arithmetic BLANK? RSQUARE -> ^(name expl= icit_arithmetic) | name; =20 variable_name_for_bang diff --git a/bashast/gunit/array.gunit b/bashast/gunit/array.gunit index 734343f..fe49511 100644 --- a/bashast/gunit/array.gunit +++ b/bashast/gunit/array.gunit @@ -46,6 +46,7 @@ variable_reference: "${asdf[4]//pattern}" -> (VAR_REF (REPLACE_ALL (asdf 4) (STRING pattern)= )) "${asdf}" -> (VAR_REF asdf) "${#asdf[0]}" -> (VAR_REF (# (asdf 0))) +"${#asdf[ $i ]}" -> (VAR_REF (# (asdf (VAR_REF i)))) "${asdf[@]}" -> (VAR_REF (ARRAY asdf @)) "${asdf[*]}" -> (VAR_REF (ARRAY asdf *)) "${#asdf[@]}" -> (VAR_REF (# (asdf ARRAY_SIZE)))