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 1QRk8y-0008PP-V7 for garchives@archives.gentoo.org; Wed, 01 Jun 2011 12:03:25 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 69D9C1C00D; 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 304601C00D for ; 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 B6CEB1B400E for ; Wed, 1 Jun 2011 12:03:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E2AD880506 for ; Wed, 1 Jun 2011 12:03:10 +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: <97cf0f6388b74c3810325d17dd7b9f1b3610c02a.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: 97cf0f6388b74c3810325d17dd7b9f1b3610c02a Date: Wed, 1 Jun 2011 12:03:10 +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: 4e71486401cb503aac27523f4f64c28b commit: 97cf0f6388b74c3810325d17dd7b9f1b3610c02a Author: Mu Qiao gentoo org> AuthorDate: Mon May 30 07:26:35 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Wed Jun 1 05:54:41 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D97cf0f63 Parser: support special variable $$ --- bashast/bashast.g | 2 ++ bashast/gunit/param_main.gunit | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index f9d5425..2e892c2 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -266,6 +266,7 @@ var_ref | DOLLAR POUND -> ^(VAR_REF POUND) | DOLLAR QMARK -> ^(VAR_REF QMARK) | DOLLAR MINUS -> ^(VAR_REF MINUS) + | DOLLAR DOLLAR -> ^(VAR_REF DOLLAR) | DOLLAR BANG -> ^(VAR_REF BANG); //Variable expansions var_exp : var_name ( @@ -317,6 +318,7 @@ var_name : num | var_name_no_digit | TIMES + | DOLLAR | AT; //Inside arithmetic we can't allow digits var_name_no_digit diff --git a/bashast/gunit/param_main.gunit b/bashast/gunit/param_main.gu= nit index 5fd818e..cfbd92f 100644 --- a/bashast/gunit/param_main.gunit +++ b/bashast/gunit/param_main.gunit @@ -54,6 +54,8 @@ var_ref: "$?" -> (VAR_REF ?) "$_" -> (VAR_REF _) "${_}" -> (VAR_REF _) +"$$" -> (VAR_REF $) +"${$}" -> (VAR_REF $) "${PV//./_}" -> (VAR_REF (REPLACE_ALL PV (STRING .) (STRING _))) "${PV// }" -> (VAR_REF (REPLACE_ALL PV (STRING ))) "${PV//[-._]/}" -> (VAR_REF (REPLACE_ALL PV (STRING (MATCH_ANY - . _))))