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 1QF6Ot-0008M0-Lm for garchives@archives.gentoo.org; Wed, 27 Apr 2011 15:11:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BC0881C07D; Wed, 27 Apr 2011 15:11:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8A5FB1C07D for ; Wed, 27 Apr 2011 15:11: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 563C91B4075 for ; Wed, 27 Apr 2011 15:11:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B36918050A for ; Wed, 27 Apr 2011 15:11: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: <67ae08a05b489c31f9df7453eea3ed8446d4f5ae.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: scripts/, bashast/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/libbashWalker.g scripts/compound_command.bash scripts/compound_command.bash.result X-VCS-Directories: scripts/ bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 67ae08a05b489c31f9df7453eea3ed8446d4f5ae Date: Wed, 27 Apr 2011 15:11: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: ee0367343dd1cb358bef788408475f4f commit: 67ae08a05b489c31f9df7453eea3ed8446d4f5ae Author: Mu Qiao gentoo org> AuthorDate: Tue Apr 26 10:47:40 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Wed Apr 27 14:58:45 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D67ae08a0 Walker: support until loop --- bashast/libbashWalker.g | 5 +++-- scripts/compound_command.bash | 12 ++++++++++++ scripts/compound_command.bash.result | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index 01c080e..8dc0b41 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -406,8 +406,9 @@ for_modification while_expr @declarations { ANTLR3_MARKER command_index; + bool negate; } - :^(WHILE { + :^((WHILE { negate =3D false; } | UNTIL { negate =3D true; }) { // omit the first DOWN token SEEK(INDEX() + 1); =20 @@ -415,7 +416,7 @@ while_expr while(true) { command_list(ctx); - if(walker->get_status()) + if(walker->get_status() =3D=3D (negate? 0 : 1)) break; command_list(ctx); SEEK(command_index); diff --git a/scripts/compound_command.bash b/scripts/compound_command.bas= h index 9da53b8..ad00e63 100644 --- a/scripts/compound_command.bash +++ b/scripts/compound_command.bash @@ -34,3 +34,15 @@ while [ $i \< 0 ] do echo "Shouldn't print this" done + +i=3D0; +until [ $i =3D=3D 4 ] +do + i=3D$(( i + 1 )) + echo $i +done + +until [ $i \> 0 ] +do + echo "Shouldn't print this" +done diff --git a/scripts/compound_command.bash.result b/scripts/compound_comm= and.bash.result index b2d305a..3e2e9f4 100644 --- a/scripts/compound_command.bash.result +++ b/scripts/compound_command.bash.result @@ -15,6 +15,10 @@ ghi 2 3 4 +1 +2 +3 +4 file=3D foo bar=20 foo=3Dghi i=3D4