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 1QCVYi-00012S-Pc for garchives@archives.gentoo.org; Wed, 20 Apr 2011 11:27:01 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E1CE91C064; Wed, 20 Apr 2011 11:26:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A1FCB1C064 for ; Wed, 20 Apr 2011 11:26:13 +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 05C1D1B4075 for ; Wed, 20 Apr 2011 11:26:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2A82380234 for ; Wed, 20 Apr 2011 11:26:12 +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: <097660eedfce9087b52a39f76264dde759208117.betelgeuse@gentoo> 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: 097660eedfce9087b52a39f76264dde759208117 Date: Wed, 20 Apr 2011 11:26:12 +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: 4929f1e208ec4cd3cd02b173e4a1b6bc commit: 097660eedfce9087b52a39f76264dde759208117 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Tue Apr 19 16:36:02 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Wed Apr 20 11:22:37 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D097660ee Parser: improve arithmetic white space handling We don't have to list blank on both sides of operators. Now the code follows the rule of always looking at white space after operators. --- bashast/bashast.g | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 9c32d58..6612dbc 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -470,15 +470,15 @@ extended_pattern_match //the square bracket from is deprecated //http://permalink.gmane.org/gmane.comp.shells.bash.bugs/14479 arithmetic_expansion - : DOLLAR LLPAREN BLANK* arithmetics BLANK* RRPAREN -> ^(ARITHMETIC_EXPR= ESSION arithmetics) - | DOLLAR LSQUARE BLANK* arithmetics BLANK* RSQUARE -> ^(ARITHMETIC_EXPR= ESSION arithmetics); + : DOLLAR LLPAREN BLANK* arithmetics RRPAREN -> ^(ARITHMETIC_EXPRESSION = arithmetics) + | DOLLAR LSQUARE BLANK* arithmetics RSQUARE -> ^(ARITHMETIC_EXPRESSION = arithmetics); //explicit arithmetic in places like array indexes explicit_arithmetic - : (DOLLAR LLPAREN BLANK*)? arithmetics (BLANK* RRPAREN)? -> arithmetics - | (DOLLAR LSQUARE BLANK*)? arithmetics (BLANK* RSQUARE)? -> arithmetics= ; + : (DOLLAR LLPAREN BLANK*)? arithmetics RRPAREN? -> arithmetics + | (DOLLAR LSQUARE BLANK*)? arithmetics RSQUARE? -> arithmetics; //The comma operator for arithmetic expansions arithmetics - : arithmetic (BLANK!* COMMA! BLANK!* arithmetic)*; + : arithmetic (COMMA! BLANK!* arithmetic)*; arithmetic : arithmetic_condition | arithmetic_assignment; @@ -498,25 +498,25 @@ pre_inc_dec | MINUS MINUS BLANK? primary -> ^(PRE_DECR primary); unary : post_inc_dec | pre_inc_dec - | primary + | primary BLANK!* | PLUS BLANK* unary -> ^(PLUS_SIGN unary) | MINUS BLANK* unary -> ^(MINUS_SIGN unary) | (TILDE|BANG)^ BLANK!* unary; exponential - : unary (BLANK!* EXP^ BLANK!* unary)* ; + : unary (EXP^ BLANK!* unary)* ; times_division_modulus - : exponential (BLANK!* (TIMES^|SLASH^|PCT^) BLANK!* exponential)*; -addsub : times_division_modulus (BLANK!* (PLUS^|MINUS^)BLANK!* times_div= ision_modulus)*; -shifts : addsub (BLANK!* (LSHIFT^|RSHIFT^) BLANK!* addsub)*; -compare : shifts (BLANK!* (LEQ^|GEQ^|LESS_THAN^|GREATER_THAN^)BLANK!* sh= ifts)?; + : exponential ((TIMES^|SLASH^|PCT^) BLANK!* exponential)*; +addsub : times_division_modulus ((PLUS^|MINUS^) BLANK!* times_division_m= odulus)*; +shifts : addsub ((LSHIFT^|RSHIFT^) BLANK!* addsub)*; +compare : shifts ((LEQ^|GEQ^|LESS_THAN^|GREATER_THAN^) BLANK!* shifts)?; bitwiseand - : compare (BLANK!* AMP^ BLANK!* compare)*; + : compare (AMP^ BLANK!* compare)*; bitwisexor - : bitwiseand (BLANK!* CARET^ BLANK!* bitwiseand)*; + : bitwiseand (CARET^ BLANK!* bitwiseand)*; bitwiseor - : bitwisexor (BLANK!* PIPE^ BLANK!* bitwisexor)*; -logicand: bitwiseor (BLANK!* LOGICAND^ BLANK!* bitwiseor)*; -logicor : logicand (BLANK!* LOGICOR^ BLANK!* logicand)*; + : bitwisexor (PIPE^ BLANK!* bitwisexor)*; +logicand: bitwiseor (LOGICAND^ BLANK!* bitwiseor)*; +logicor : logicand (LOGICOR^ BLANK!* logicand)*; =20 arithmetic_condition : cnd=3Dlogicor QMARK t=3Dlogicor COLON f=3Dlogicor -> ^(ARITHMETIC_CON= DITION $cnd $t $f);