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 1QoyR1-00075I-5h for garchives@archives.gentoo.org; Thu, 04 Aug 2011 13:58:03 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A429521C1D2; Thu, 4 Aug 2011 13:53:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 77C9C21C1D3 for ; Thu, 4 Aug 2011 13:53:40 +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 C8EE21B4042 for ; Thu, 4 Aug 2011 13:53:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2629F8004B for ; Thu, 4 Aug 2011 13:53:39 +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: <8d0126787eaf4ee648ebe7f47a8048dc3c15c88e.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: bashast/, test/, bashast/gunit/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/bashast.g bashast/gunit/simp_command.gunit test/walker_test.cpp X-VCS-Directories: bashast/ test/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 8d0126787eaf4ee648ebe7f47a8048dc3c15c88e Date: Thu, 4 Aug 2011 13:53:39 +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: 6151b3388dc8de7e04b710f9cd0ea90c commit: 8d0126787eaf4ee648ebe7f47a8048dc3c15c88e Author: Mu Qiao gentoo org> AuthorDate: Thu Jul 21 09:00:05 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Tue Aug 2 07:46:29 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D8d012678 Parser: allow braces in command arguments --- bashast/bashast.g | 8 +++++++- bashast/gunit/simp_command.gunit | 2 +- test/walker_test.cpp | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 65cc493..14d7d10 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -404,7 +404,13 @@ bash_command_arguments : bash_command_argument_atom+ -> ^(STRING bash_command_argument_atom+); // TODO support brace expansion and braces bash_command_argument_atom - : string_expr_part; + : (LBRACE) =3D> + ( + (brace_expansion) =3D> brace_expansion + |LBRACE + ) + | RBRACE + | string_expr_part; =20 parens : LPAREN BLANK? RPAREN; diff --git a/bashast/gunit/simp_command.gunit b/bashast/gunit/simp_comman= d.gunit index d7b25e9..965b351 100644 --- a/bashast/gunit/simp_command.gunit +++ b/bashast/gunit/simp_command.gunit @@ -28,7 +28,7 @@ command_atom: "cat ~/Documents/todo.txt" -> (STRING cat) (STRING ~ / Documents / todo = . txt) "dodir ${foo}/${bar}" -> (STRING dodir) (STRING (VAR_REF foo) / (VAR_REF= bar)) "local a=3D123 b=3D(1 2 3) c" -> (VARIABLE_DEFINITIONS local (=3D a (STR= ING 123)) (=3D b (ARRAY (STRING 1) (STRING 2) (STRING 3))) (EQUALS c)) -//"echo {}{}}{{{}}{{}" -> (STRING echo) (STRING { } { } } { { { } } { { = }) +"echo {}{}}{{{}}{{}" -> (STRING echo) (STRING { } { } } { { { } } { { }) "echo \"ab#af ###\" #abc" -> (STRING echo) (STRING (DOUBLE_QUOTED_STRING= ab # af ## #)) =20 command: diff --git a/test/walker_test.cpp b/test/walker_test.cpp index 4a69e9f..4f87c26 100644 --- a/test/walker_test.cpp +++ b/test/walker_test.cpp @@ -91,7 +91,6 @@ TEST(extglob, used_when_disabled) } } =20 -/* TEST(brace_expansion, not_in_raw_string) { interpreter walker; @@ -100,4 +99,4 @@ TEST(brace_expansion, not_in_raw_string) std::istringstream input(script); bash_ast ast(input); EXPECT_THROW(ast.interpret_with(walker), libbash::unsupported_exceptio= n); -} */ +}