public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/libbash:master commit in: bashast/, test/, bashast/gunit/
Date: Thu,  4 Aug 2011 13:53:39 +0000 (UTC)	[thread overview]
Message-ID: <8d0126787eaf4ee648ebe7f47a8048dc3c15c88e.betelgeuse@gentoo> (raw)

commit:     8d0126787eaf4ee648ebe7f47a8048dc3c15c88e
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 09:00:05 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue Aug  2 07:46:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=8d012678

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) =>
+		(
+			(brace_expansion) => brace_expansion
+			|LBRACE
+		)
+	|	RBRACE
+	|	string_expr_part;
 
 parens
 	:	LPAREN BLANK? RPAREN;

diff --git a/bashast/gunit/simp_command.gunit b/bashast/gunit/simp_command.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=123 b=(1 2 3) c" -> (VARIABLE_DEFINITIONS local (= a (STRING 123)) (= 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   ## #))
 
 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)
   }
 }
 
-/*
 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_exception);
-}  */
+}



             reply	other threads:[~2011-08-04 13:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 13:53 Petteri Räty [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-16 16:53 [gentoo-commits] proj/libbash:master commit in: bashast/, test/, bashast/gunit/ Petteri Räty
2011-06-01 12:03 Petteri Räty
2011-04-11  6:50 Petteri Räty
2011-04-09 13:08 Petteri Räty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d0126787eaf4ee648ebe7f47a8048dc3c15c88e.betelgeuse@gentoo \
    --to=betelgeuse@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox