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 1QBPht-0002Zy-Dd for garchives@archives.gentoo.org; Sun, 17 Apr 2011 10:59:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E7FC1C00D; Sun, 17 Apr 2011 10:58:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0299F1C00D for ; Sun, 17 Apr 2011 10:58:29 +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 771431B4026 for ; Sun, 17 Apr 2011 10:58:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C0C2280065 for ; Sun, 17 Apr 2011 10:58:28 +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: <351f71b0267b090cc5825fafeb9eef6ee102169f.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/fname.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 351f71b0267b090cc5825fafeb9eef6ee102169f Date: Sun, 17 Apr 2011 10:58:28 +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: b7004b8dc3d7d2a87fcf503868b5aa9d commit: 351f71b0267b090cc5825fafeb9eef6ee102169f Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Fri Apr 15 12:53:58 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sun Apr 17 10:44:18 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D351f71b0 Parser: other expansions inside pathname expansion Pathname expansions like configu[e${a}] are now supported. --- bashast/bashast.g | 8 +++++++- bashast/gunit/fname.gunit | 1 + 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 4bd3447..d5c3415 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -413,7 +413,13 @@ bracket_pattern_match //allowable patterns with bracket pattern matching pattern_match : pattern_class_match - | str_part str_part_with_pound*; + | pattern_string_part+; +pattern_string_part + : var_ref + | command_sub + | arithmetic_expansion + | ns_str_part; + //special class patterns to match: [:alpha:] etc pattern_class_match : LSQUARE COLON NAME COLON RSQUARE -> ^(CHARACTER_CLASS NAME) diff --git a/bashast/gunit/fname.gunit b/bashast/gunit/fname.gunit index e783504..eb8f080 100644 --- a/bashast/gunit/fname.gunit +++ b/bashast/gunit/fname.gunit @@ -48,6 +48,7 @@ fname: "ctrlx\cx" -> (STRING ctrlx \ cx) "tab\\ttab" -> "(STRING tab \\ \t tab)" "abc[def]" -> (STRING abc (MATCH_PATTERN def)) +"abc[d${more}]" -> (STRING abc (MATCH_PATTERN d (VAR_REF more))) "a[]" -> (STRING a [ ]) "ab[d-h]" -> (STRING ab (MATCH_PATTERN d - h)) "ab[!d-h]" -> (STRING ab (MATCH_ANY_EXCEPT d - h))