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 1Q99ZI-0004LI-Md for garchives@archives.gentoo.org; Mon, 11 Apr 2011 05:21:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E4FC71C044; Mon, 11 Apr 2011 05:21:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B38A01C03F for ; Mon, 11 Apr 2011 05:21:17 +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 35EA11B40D2 for ; Mon, 11 Apr 2011 05:21:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 621D28007A for ; Mon, 11 Apr 2011 05:21:16 +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: <976e5bde79b1286fbf45f3ac2abcf124ade06d22.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/param_main.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 976e5bde79b1286fbf45f3ac2abcf124ade06d22 Date: Mon, 11 Apr 2011 05:21:16 +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: 38453ec0ac748797976b0adbe67ed46c commit: 976e5bde79b1286fbf45f3ac2abcf124ade06d22 Author: Mu Qiao gentoo org> AuthorDate: Mon Apr 11 01:31:05 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Mon Apr 11 01:39:01 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D976e5bde Add '#' to var_name wrt bug #362795 '#' is a valid variable name in variable expansion as it stands for the number of arguments. --- bashast/bashast.g | 2 +- bashast/gunit/param_main.gunit | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index d8dfc77..31aa368 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -268,7 +268,7 @@ var_exp : var_name (USE_DEFAULT|USE_ALTERNATE|DISPLAY= _ERROR|ASSIGN_DEFAULT)^ wor | TIMES | AT; //Allowable variable names in the variable expansion -var_name: num|name; +var_name: num|name|POUND; //Referencing an array variable arr_var_ref : name^ LSQUARE! DIGIT+ RSQUARE!; diff --git a/bashast/gunit/param_main.gunit b/bashast/gunit/param_main.gu= nit index a865e16..c6194de 100644 --- a/bashast/gunit/param_main.gunit +++ b/bashast/gunit/param_main.gunit @@ -43,7 +43,9 @@ var_ref: "$@" -> (VAR_REF @) "$*" -> (VAR_REF *) "${@}" -> (VAR_REF @) +"${#}" -> (VAR_REF #) "${!foo}" -> (VAR_REF (VAR_REF foo)) +"${!#}" -> (VAR_REF (VAR_REF #)) "${3}" -> (VAR_REF 3) "$?" -> (VAR_REF ?) "$_" -> (VAR_REF _)