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 1Q7sKg-0001Nt-Ig for garchives@archives.gentoo.org; Thu, 07 Apr 2011 16:45:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AF1A71C0B0; Thu, 7 Apr 2011 16:45:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8010D1C0B2 for ; Thu, 7 Apr 2011 16:45:00 +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 1CDB01BC0DD for ; Thu, 7 Apr 2011 16:45:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 73E7680073 for ; Thu, 7 Apr 2011 16:44:59 +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/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/bashast.g X-VCS-Directories: bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: b5c3aeace9f791de74b93c35c2118cc67f8db0f1 Date: Thu, 7 Apr 2011 16:44:59 +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: 5f11f6bee50478b6a3f53b8788ec2b1b commit: b5c3aeace9f791de74b93c35c2118cc67f8db0f1 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Thu Apr 7 09:10:11 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Thu Apr 7 16:39:17 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Db5c3aeac Use negation to simplify sqstr rule Instead of listing all the alternatives use negation to find out where the single quoted string ends. --- bashast/bashast.g | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 7126bdd..3d52c27 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -372,10 +372,6 @@ ns_str : ns_str_part* -> ^(STRING ns_str_part*); dq_str_part : BLANK|EOL|AMP|LOGICAND|LOGICOR|LESS_THAN|GREATER_THAN|PIPE|SQUOTE|SEM= IC|COMMA|LPAREN|RPAREN|LLPAREN|RRPAREN|DOUBLE_SEMIC|LBRACE|RBRACE|TICK|LE= Q|GEQ | str_part_with_pound; -//Allowable parts of single quoted strings -sq_str_part - : str_part_with_pound - | BLANK|EOL|AMP|LOGICAND|LOGICOR|LESS_THAN|GREATER_THAN|PIPE|QUOTE|SEMI= C|COMMA|LPAREN|RPAREN|LLPAREN|RRPAREN|DOUBLE_SEMIC|LBRACE|RBRACE|DOLLAR|T= ICK|BOP|UOP; //Generic strings/filenames. fname : nqstr -> ^(STRING nqstr); //A string that is NOT a bash reserved word @@ -411,7 +407,9 @@ dqstr_part | pattern_match_trigger | BANG; //single quoted string rule, no expansions -sqstr : SQUOTE sq_str_part* SQUOTE -> ^(SINGLE_QUOTED_STRING sq_str_part= *); +sqstr_part + : ~SQUOTE*; +sqstr : SQUOTE sqstr_part SQUOTE -> ^(SINGLE_QUOTED_STRING sqstr_part); //certain tokens that trigger pattern matching pattern_match_trigger : LSQUARE