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.77) (envelope-from ) id 1SnnqK-0006kI-T8 for garchives@archives.gentoo.org; Sun, 08 Jul 2012 09:31:53 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 053ABE0128; Sun, 8 Jul 2012 09:31:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C9FFFE0138 for ; Sun, 8 Jul 2012 09:31:20 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 402F71B4013 for ; Sun, 8 Jul 2012 09:31:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0CBEEE5442 for ; Sun, 8 Jul 2012 09:31:18 +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: <1341739350.d23dab871c34b69444bab8ef0f30ca45314600f8.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: scripts/, bashast/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/libbashWalker.g scripts/command_execution.bash X-VCS-Directories: scripts/ bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: d23dab871c34b69444bab8ef0f30ca45314600f8 X-VCS-Branch: master Date: Sun, 8 Jul 2012 09:31:18 +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: 57339a91-a872-491c-adc6-6abd0726af9b X-Archives-Hash: bfa40712d91b6a4146551ced8e9d7f71 commit: d23dab871c34b69444bab8ef0f30ca45314600f8 Author: Andr=C3=A9 Apar=C3=ADcio gmail com> AuthorDate: Tue May 29 18:26:04 2012 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sun Jul 8 09:22:30 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Dd23dab87 Walker: Improve command list to support "command && command && command" --- bashast/libbashWalker.g | 7 ++++--- scripts/command_execution.bash | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index 9157574..0c21ccd 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -736,18 +736,19 @@ argument[std::vector& args, bool split= ] } }; =20 -logic_command_list +logic_command @declarations { bool logic_and; } - :command - |^((LOGICAND { logic_and =3D true; } | LOGICOR { logic_and =3D false; }= ) command { + : ^((LOGICAND { logic_and =3D true; } | LOGICOR { logic_and =3D false; = }) logic_command_list { if(logic_and ? !walker->get_status() : walker->get_status()) command(ctx); else seek_to_next_tree(ctx); }); =20 +logic_command_list: command | logic_command; + command_list: ^(LIST logic_command_list+); =20 compound_command diff --git a/scripts/command_execution.bash b/scripts/command_execution.b= ash index 58f1279..4c04908 100644 --- a/scripts/command_execution.bash +++ b/scripts/command_execution.bash @@ -17,6 +17,9 @@ false && echo "wrong" false || echo "right" true ||=20 echo "wrong" +echo right1 && echo right2 && false && echo wrong +false || echo right3 || echo wrong +true && false || echo right4 && echo right5 echo "end" : ${DEFAULTED:=3D"yes"} FOO=3D"abc" echo "command environment"