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 1Q9Xt1-0002C5-Ey for garchives@archives.gentoo.org; Tue, 12 Apr 2011 07:19:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9A81E1C0AF; Tue, 12 Apr 2011 07:19:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 64E4A1C0AF for ; Tue, 12 Apr 2011 07:19:16 +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 209B91BC0F9 for ; Tue, 12 Apr 2011 07:19:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7DEE280073 for ; Tue, 12 Apr 2011 07:19:15 +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: c7c59452375df8fcd408785e422c53035b141ebd Date: Tue, 12 Apr 2011 07:19:15 +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: 29836ec0dc83724593a9592f18000237 commit: c7c59452375df8fcd408785e422c53035b141ebd Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Mon Apr 11 17:42:10 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Tue Apr 12 06:23:31 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Dc7c59452 Refactor nqstr rule for readability Move each alternative to own line, rename to nsqrt_part and move the plus operator the callers. This should make the rule easier to read. --- bashast/bashast.g | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 6148318..510ef90 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -367,12 +367,23 @@ ns_str : ns_str_part* -> ^(STRING ns_str_part*); fname : fname_part+ -> ^(STRING fname_part+); //A string that is NOT a bash reserved word fname_no_res_word - : nqstr fname_part* -> ^(STRING nqstr fname_part*); + : nqstr_part+ fname_part* -> ^(STRING nqstr_part+ fname_part*); fname_part - : nqstr + : nqstr_part+ | res_word_str; -//non-quoted string rule, allows expansions -nqstr : (bracket_pattern_match|extended_pattern_match|var_ref|command_su= b|arithmetic_expansion|brace_expansion|dqstr|sqstr|(str_part str_part_wit= h_pound*)|pattern_match_trigger|BANG)+; +//non-quoted string part rule, allows expansions +nqstr_part + : bracket_pattern_match + | extended_pattern_match + | var_ref + | command_sub + | arithmetic_expansion + | brace_expansion + | dqstr + | sqstr + | str_part str_part_with_pound* + | pattern_match_trigger + | BANG; //double quoted string rule, allows expansions dqstr : QUOTE dqstr_part* QUOTE -> ^(DOUBLE_QUOTED_STRING dqstr_part*); dqstr_part