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 1QK3i0-0003re-W4 for garchives@archives.gentoo.org; Wed, 11 May 2011 07:19:49 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5C94E1C0CE; Wed, 11 May 2011 07:19:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2DADC1C0C6 for ; Wed, 11 May 2011 07:19:36 +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 C0F681B40A3 for ; Wed, 11 May 2011 07:19:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 3111080506 for ; Wed, 11 May 2011 07:19:35 +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: Subject: [gentoo-commits] proj/libbash:master commit in: scripts/, bashast/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/libbashWalker.g scripts/compound_command.bash scripts/compound_command.bash.result X-VCS-Directories: scripts/ bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: b7ca45122d791c6a76edf9104f49aea3737ee516 Date: Wed, 11 May 2011 07:19:35 +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: d55e6a41e2b3be56b3c905b41fbd3b68 commit: b7ca45122d791c6a76edf9104f49aea3737ee516 Author: Mu Qiao gentoo org> AuthorDate: Mon May 9 13:24:15 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Wed May 11 06:45:04 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Db7ca4512 Walker: fix a bug in word rule Inside the word rule, we used arithmetic rule to do variable reference. But that requires the variable to be integer. Now it's fixed by adding a variable reference alternative. --- bashast/libbashWalker.g | 1 + scripts/compound_command.bash | 1 + scripts/compound_command.bash.result | 2 +- 3 files changed, 3 insertions(+), 1 deletions(-) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index e328c21..16e4624 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -306,6 +306,7 @@ var_expansion returns[std::string libbash_value] word returns[std::string libbash_value] :(num) =3D> libbash_string=3Dnum { $libbash_value =3D libbash_string; } |string_expr { $libbash_value =3D $string_expr.libbash_value; } + |(VAR_REF) =3D> libbash_string=3Dvar_ref[false] { $libbash_value =3D li= bbash_string; } |value=3Darithmetics { $libbash_value =3D boost::lexical_cast(value); }; =20 //variable reference diff --git a/scripts/compound_command.bash b/scripts/compound_command.bas= h index b521b77..1bd7943 100644 --- a/scripts/compound_command.bash +++ b/scripts/compound_command.bash @@ -98,6 +98,7 @@ case $target in echo "Shouldn't print this" ;; esac +target=3Dxyz case $target in bcd) echo "Shouldn't print this" diff --git a/scripts/compound_command.bash.result b/scripts/compound_comm= and.bash.result index 69d693d..08ddf31 100644 --- a/scripts/compound_command.bash.result +++ b/scripts/compound_command.bash.result @@ -31,4 +31,4 @@ b=3D2 file=3D foo bar=20 foo=3Dghi i=3D4 -target=3D123 +target=3Dxyz