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 1QK3iP-0003uG-0x for garchives@archives.gentoo.org; Wed, 11 May 2011 07:20:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 427741C0C7; Wed, 11 May 2011 07:19:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 015001C0C6 for ; Wed, 11 May 2011 07:19:35 +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 740F81B40AB for ; Wed, 11 May 2011 07:19:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B8D348050A for ; Wed, 11 May 2011 07:19:34 +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: <495848c85f4c54af8fed466d09bd474fbdf37568.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 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: 495848c85f4c54af8fed466d09bd474fbdf37568 Date: Wed, 11 May 2011 07:19:34 +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: d403911c8b24ffa329342c386ae6ec7f commit: 495848c85f4c54af8fed466d09bd474fbdf37568 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Tue May 10 17:53:03 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Tue May 10 17:53:03 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D495848c8 Parser: rename MATCH_PATTERN to MATCH_ANY The token is used to describe bracket pattern matching expressions where any of the atoms inside the brackets can match to MATCH_ANY is a more descriptive name. --- bashast/bashast.g | 6 +++--- bashast/gunit/fname.gunit | 28 ++++++++++++++-------------- bashast/gunit/param_main.gunit | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 977e8c8..220d01f 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -68,7 +68,7 @@ tokens{ EXTENDED_MATCH_NONE; EXTENDED_MATCH_ANY; EXTENDED_MATCH_AT_LEAST_ONE; - MATCH_PATTERN; + MATCH_ANY; MATCH_ANY_EXCEPT; CHARACTER_CLASS; EQUIVALENCE_CLASS; @@ -450,9 +450,9 @@ pattern_match_trigger //Pattern matching using brackets bracket_pattern_match : LSQUARE RSQUARE (BANG|CARET) pattern_match* RSQUARE -> ^(MATCH_ANY_EX= CEPT RSQUARE pattern_match*) - | LSQUARE RSQUARE pattern_match* RSQUARE -> ^(MATCH_PATTERN RSQUARE pat= tern_match*) + | LSQUARE RSQUARE pattern_match* RSQUARE -> ^(MATCH_ANY RSQUARE pattern= _match*) | LSQUARE (BANG|CARET) pattern_match+ RSQUARE -> ^(MATCH_ANY_EXCEPT pat= tern_match+) - | LSQUARE pattern_match+ RSQUARE -> ^(MATCH_PATTERN pattern_match+); + | LSQUARE pattern_match+ RSQUARE -> ^(MATCH_ANY pattern_match+); //allowable patterns with bracket pattern matching pattern_match : pattern_class_match diff --git a/bashast/gunit/fname.gunit b/bashast/gunit/fname.gunit index cfde61b..c12449b 100644 --- a/bashast/gunit/fname.gunit +++ b/bashast/gunit/fname.gunit @@ -47,24 +47,24 @@ fname: "hex\xaF" -> (STRING hex \ xaF) "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))) -"abc[#d]" -> (STRING abc (MATCH_PATTERN # d)) -"abc[d#]" -> (STRING abc (MATCH_PATTERN d #)) +"abc[def]" -> (STRING abc (MATCH_ANY def)) +"abc[d${more}]" -> (STRING abc (MATCH_ANY d (VAR_REF more))) +"abc[#d]" -> (STRING abc (MATCH_ANY # d)) +"abc[d#]" -> (STRING abc (MATCH_ANY d #)) "a[]" -> (STRING a [ ]) -"ab[d-h]" -> (STRING ab (MATCH_PATTERN d - h)) +"ab[d-h]" -> (STRING ab (MATCH_ANY d - h)) "ab[!d-h]" -> (STRING ab (MATCH_ANY_EXCEPT d - h)) "ab[^d-h]" -> (STRING ab (MATCH_ANY_EXCEPT d - h)) -"ab[]c]" -> (STRING ab (MATCH_PATTERN ] c)) -"ab[:alpha:]" -> (STRING ab (MATCH_PATTERN : alpha :)) -"ab[=3Dc=3D]" -> (STRING ab (MATCH_PATTERN =3D c =3D)) -"ab[.c.]" -> (STRING ab (MATCH_PATTERN . c .)) -"ab[[:alpha:]]" -> (STRING ab (MATCH_PATTERN (CHARACTER_CLASS alpha))) -"ab[[:alpha:][:digit:]]" -> (STRING ab (MATCH_PATTERN (CHARACTER_CLASS a= lpha) (CHARACTER_CLASS digit))) +"ab[]c]" -> (STRING ab (MATCH_ANY ] c)) +"ab[:alpha:]" -> (STRING ab (MATCH_ANY : alpha :)) +"ab[=3Dc=3D]" -> (STRING ab (MATCH_ANY =3D c =3D)) +"ab[.c.]" -> (STRING ab (MATCH_ANY . c .)) +"ab[[:alpha:]]" -> (STRING ab (MATCH_ANY (CHARACTER_CLASS alpha))) +"ab[[:alpha:][:digit:]]" -> (STRING ab (MATCH_ANY (CHARACTER_CLASS alpha= ) (CHARACTER_CLASS digit))) "ab[^[:alpha:]]" -> (STRING ab (MATCH_ANY_EXCEPT (CHARACTER_CLASS alpha)= )) -"ab[[=3Dc=3D]]" -> (STRING ab (MATCH_PATTERN (EQUIVALENCE_CLASS c))) -"ab[[.backslash.]]" -> (STRING ab (MATCH_PATTERN (COLLATING_SYMBOL backs= lash))) -"ab[12[:alpha:]]" -> (STRING ab (MATCH_PATTERN 12 (CHARACTER_CLASS alpha= ))) +"ab[[=3Dc=3D]]" -> (STRING ab (MATCH_ANY (EQUIVALENCE_CLASS c))) +"ab[[.backslash.]]" -> (STRING ab (MATCH_ANY (COLLATING_SYMBOL backslash= ))) +"ab[12[:alpha:]]" -> (STRING ab (MATCH_ANY 12 (CHARACTER_CLASS alpha))) "\"'foo'\"" -> (STRING (DOUBLE_QUOTED_STRING ' foo ')) "--preserve=3Dtimestamps,mode" -> (STRING - -p reserve =3D timestamps , = mode) =20 diff --git a/bashast/gunit/param_main.gunit b/bashast/gunit/param_main.gu= nit index 91ed8be..54a2edb 100644 --- a/bashast/gunit/param_main.gunit +++ b/bashast/gunit/param_main.gunit @@ -56,7 +56,7 @@ 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_PATTERN - . _= )))) +"${PV//[-._]/}" -> (VAR_REF (REPLACE_ALL PV (STRING (MATCH_ANY - . _)))) "${PV/${pattern}/${replace}}" -> (VAR_REF (REPLACE_FIRST PV (STRING (VAR= _REF pattern)) (STRING (VAR_REF replace)))) "${PV/#foo/bar}" -> (VAR_REF (REPLACE_AT_START PV (STRING foo) (STRING b= ar))) "${PV/%foo/bar}" -> (VAR_REF (REPLACE_AT_END PV (STRING foo) (STRING bar= )))