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 1Q8CeZ-0001ra-H3 for garchives@archives.gentoo.org; Fri, 08 Apr 2011 14:27:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A65FC1C039; Fri, 8 Apr 2011 14:26:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 77B181C039 for ; Fri, 8 Apr 2011 14:26:33 +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 1091B1BC016 for ; Fri, 8 Apr 2011 14:26:32 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 05E1B80074 for ; Fri, 8 Apr 2011 14:26:31 +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: 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: b28640eea98b8d3e691c83fece6ef66dcfa49976 Date: Fri, 8 Apr 2011 14:26:31 +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: 780b20e5cf848019e838cb76354db039 commit: b28640eea98b8d3e691c83fece6ef66dcfa49976 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Fri Apr 8 13:41:29 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Fri Apr 8 13:41:29 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Db28640ee Simplify $_ handling The special variable doesn't need its own branch as the name rule already covers it. --- bashast/bashast.g | 3 +-- bashast/gunit/param_main.gunit | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 7f4bed5..e167f9f 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -246,8 +246,7 @@ var_ref | DOLLAR POUND -> ^(VAR_REF POUND) | DOLLAR QMARK -> ^(VAR_REF QMARK) | DOLLAR MINUS -> ^(VAR_REF MINUS) - | DOLLAR BANG -> ^(VAR_REF BANG) - | DOLLAR '_' -> ^(VAR_REF '_'); + | DOLLAR BANG -> ^(VAR_REF BANG); //Variable expansions var_exp : var_name (USE_DEFAULT|USE_ALTERNATE|DISPLAY_ERROR|ASSIGN_DEFAU= LT)^ word | var_name COLON wspace* LPAREN? os=3Darithmetic RPAREN? (COLON len=3Da= rithmetic)? -> ^(OFFSET var_name $os ^($len)?) diff --git a/bashast/gunit/param_main.gunit b/bashast/gunit/param_main.gu= nit index eb49309..6668dd9 100644 --- a/bashast/gunit/param_main.gunit +++ b/bashast/gunit/param_main.gunit @@ -45,6 +45,8 @@ var_ref: "${@}" -> (VAR_REF @) "${3}" -> (VAR_REF 3) "$?" -> (VAR_REF ?) +"$_" -> (VAR_REF _) +"${_}" -> (VAR_REF _) "${PV//./_}" -> (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _))) "${PV/#foo/bar}" -> (VAR_REF (REPLACE_FIRST PV (STRING foo) (STRING bar)= )) "${PV/%foo/bar}" -> (VAR_REF (REPLACE_LAST PV (STRING foo) (STRING bar))= )