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 1QZ0sh-0000Y4-2i for garchives@archives.gentoo.org; Tue, 21 Jun 2011 13:20:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6F0301C008; Tue, 21 Jun 2011 13:20:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 223D31C008 for ; Tue, 21 Jun 2011 13:20:31 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6E8EB2AC01B for ; Tue, 21 Jun 2011 13:20:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C87268003C for ; Tue, 21 Jun 2011 13:20:29 +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: <02be4fab385d753f3a98e77d89cc0c985072e2ad.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/compound.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 02be4fab385d753f3a98e77d89cc0c985072e2ad Date: Tue, 21 Jun 2011 13:20:29 +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: 60be1388171d3974ba645fb6c9410e6b commit: 02be4fab385d753f3a98e77d89cc0c985072e2ad Author: Mu Qiao gentoo org> AuthorDate: Mon Jun 20 08:24:41 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Mon Jun 20 08:24:41 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D02be4fab Parser: fix comment handling at the end of if block --- bashast/bashast.g | 2 +- bashast/gunit/compound.gunit | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 571ed54..5bba0f9 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -209,7 +209,7 @@ for_expr: FOR BLANK+ name (wspace IN (BLANK+ fname)+)= ? semiel DO wspace* clist s ; sel_expr: SELECT BLANK+ name (wspace IN BLANK+ fname)? semiel DO wspace*= clist semiel DONE -> ^(SELECT name fname? clist) ; -if_expr : IF wspace+ ag=3Dclist semiel THEN wspace+ iflist=3Dclist semie= l EOL* (elif_expr)* (ELSE wspace+ else_list=3Dclist semiel EOL*)? FI +if_expr : IF wspace+ ag=3Dclist semiel THEN wspace+ iflist=3Dclist semie= l wspace* (elif_expr)* (ELSE wspace+ else_list=3Dclist semiel EOL*)? FI -> ^(IF_STATEMENT ^(IF $ag $iflist) (elif_expr)* ^(ELSE $else_list)?) ; elif_expr diff --git a/bashast/gunit/compound.gunit b/bashast/gunit/compound.gunit index 3ea38a6..c1e7a55 100644 --- a/bashast/gunit/compound.gunit +++ b/bashast/gunit/compound.gunit @@ -123,6 +123,13 @@ elif echo yay4; then echo hurrah else echo darn fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING echo) (STRING yay2))) (L= IST (COMMAND (STRING echo) (STRING yay)))) (if (LIST (COMMAND (STRING ech= o) (STRING yay3))) (LIST (COMMAND (STRING echo) (STRING boo)))) (if (LIST= (COMMAND (STRING echo) (STRING yay4))) (LIST (COMMAND (STRING echo) (STR= ING hurrah)))) (else (LIST (COMMAND (STRING echo) (STRING darn))))) =20 +"if true; then + echo true + # comment + elif false; then + echo false + fi" -> (IF_STATEMENT (if (LIST (COMMAND (STRING true))) (LIST (COMMA= ND (STRING echo) (STRING true)))) (if (LIST (COMMAND (STRING false))) (LI= ST (COMMAND (STRING echo) (STRING false))))) + while_expr: "while echo true; do echo \"file found\"