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 1QoyNg-0005pz-U1 for garchives@archives.gentoo.org; Thu, 04 Aug 2011 13:54:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E141221C1CD; Thu, 4 Aug 2011 13:53:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B352121C1CB for ; Thu, 4 Aug 2011 13:53:39 +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 6130E1B403D for ; Thu, 4 Aug 2011 13:53:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 3465E80038 for ; Thu, 4 Aug 2011 13:53:38 +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: ee63385cbb090865646a14fd2c0dd9fd828ad525 Date: Thu, 4 Aug 2011 13:53:38 +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: 49dae06d829e72d5fa8f079a9a4c6fd5 commit: ee63385cbb090865646a14fd2c0dd9fd828ad525 Author: Mu Qiao gentoo org> AuthorDate: Wed Jul 20 12:26:22 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Wed Jul 20 15:15:45 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Dee63385c Parser: fix delete expansion --- bashast/bashast.g | 6 ++++-- bashast/gunit/param_main.gunit | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index c54adae..9537a0e 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -711,8 +711,8 @@ parameter_expansion -> ^(parameter_value_operator variable_name parameter_expansion_valu= e) | COLON BLANK? os=3Dexplicit_arithmetic (COLON BLANK? len=3Dexplicit_= arithmetic)? -> ^(OFFSET variable_name $os ^($len)?) - | parameter_delete_operator parameter_replace_pattern - -> ^(parameter_delete_operator variable_name parameter_replace_patte= rn) + | parameter_delete_operator parameter_delete_pattern + -> ^(parameter_delete_operator variable_name parameter_delete_patter= n) | parameter_replace_operator parameter_replace_pattern (SLASH paramet= er_expansion_value)? -> ^(parameter_replace_operator variable_name parameter_replace_patt= ern parameter_expansion_value?) | BLANK? -> variable_name @@ -741,6 +741,8 @@ parameter_value_operator | PLUS -> USE_ALTERNATE_WHEN_UNSET; parameter_replace_pattern : ((~SLASH) =3D> parameter_pattern_part)+ -> ^(STRING parameter_pattern= _part+); +parameter_delete_pattern + : parameter_pattern_part+ -> ^(STRING parameter_pattern_part+); parameter_pattern_part : extended_pattern_match|BLANK|SEMIC; =20 diff --git a/bashast/gunit/param_main.gunit b/bashast/gunit/param_main.gu= nit index f2b8cbb..677b566 100644 --- a/bashast/gunit/param_main.gunit +++ b/bashast/gunit/param_main.gunit @@ -42,7 +42,7 @@ variable_reference: "${foo%bar}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING bar))) "${foo%%bar}" -> (VAR_REF (REPLACE_AT_END foo (STRING bar))) "${foo%; *}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING ; MATCH_ALL))= ) -//"${foo%/}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING /))) +"${foo%/}" -> (VAR_REF (LAZY_REMOVE_AT_END foo (STRING /))) "${this/is/pattern}"->(VAR_REF (REPLACE_FIRST this (STRING is) (STRING p= attern))) //Test positional/special parameters "$1" -> (VAR_REF 1)