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 1QCVYp-00015m-8o for garchives@archives.gentoo.org; Wed, 20 Apr 2011 11:27:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 67E571C088; Wed, 20 Apr 2011 11:26:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2D72D1C088 for ; Wed, 20 Apr 2011 11:26:15 +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 1AD8C1B407C for ; Wed, 20 Apr 2011 11:26:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 79B408022A for ; Wed, 20 Apr 2011 11:26:13 +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: <2bb591fd2cc27fca8ce2c65eb3a3afbb58810e97.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/expansions.gunit bashast/gunit/list.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 2bb591fd2cc27fca8ce2c65eb3a3afbb58810e97 Date: Wed, 20 Apr 2011 11:26:13 +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: edd75d0f25aa79ac0325cd8118788818 commit: 2bb591fd2cc27fca8ce2c65eb3a3afbb58810e97 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Tue Apr 19 20:30:21 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Wed Apr 20 11:22:48 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D2bb591fd Parser: remove list rule Having clist and list doing pretty much the same thing is confusing. Removed the list rule and moved handling things in the end to the start rule. --- bashast/bashast.g | 4 +--- bashast/gunit/expansions.gunit | 2 +- bashast/gunit/list.gunit | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 61c5914..0dc931f 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -92,13 +92,11 @@ tokens{ MINUS_SIGN; } =20 -start : (flcomment!)? EOL!* list^ ; +start : (flcomment)? EOL* clist BLANK* (SEMIC|AMP|EOL)? -> clist; //Because the comment token doesn't handle the first comment in a file i= f it's on the first line, have a parser rule for it flcomment : POUND ~(EOL)* EOL; -list : list_level_2 BLANK* (SEMIC|AMP|EOL)? -> ^(LIST list_level_2); clist -options{greedy=3Dfalse;} : list_level_2 -> ^(LIST list_level_2); list_level_1 : (function|pipeline) (BLANK!*(LOGICAND^|LOGICOR^)BLANK!* (function|pip= eline))*; diff --git a/bashast/gunit/expansions.gunit b/bashast/gunit/expansions.gu= nit index 4ea5924..bbfa37a 100644 --- a/bashast/gunit/expansions.gunit +++ b/bashast/gunit/expansions.gunit @@ -18,7 +18,7 @@ */ gunit bashast; =20 -list: +clist: "echo a{b,c,d}" -> (LIST (COMMAND (STRING echo) (STRING a (BRACE_EXP (ST= RING b) (STRING c) (STRING d))))) "((5+5))" -> (LIST (COMPOUND_ARITH (+ 5 5))) "(( 4 + asdf ))" -> (LIST (COMPOUND_ARITH (+ 4 (VAR_REF asdf)))) diff --git a/bashast/gunit/list.gunit b/bashast/gunit/list.gunit index 42836ca..76c46b2 100644 --- a/bashast/gunit/list.gunit +++ b/bashast/gunit/list.gunit @@ -18,7 +18,7 @@ */ gunit bashast; =20 -list: +start: "make" -> (LIST (COMMAND (STRING make))) "make && make modules_install;" -> (LIST (&& (COMMAND (STRING make)) (CO= MMAND (STRING make) (STRING modules_install)))) "make && make modules_install &" -> (LIST (&& (COMMAND (STRING make)) (C= OMMAND (STRING make) (STRING modules_install))))