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: scripts/, bashast/, bashast/gunit/
Date: Sun,  3 Jun 2012 09:08:41 +0000 (UTC)	[thread overview]
Message-ID: <1332763483.c8b13641610f4f6b37b15a91f9f5ff390071545e.betelgeuse@gentoo> (raw)

commit:     c8b13641610f4f6b37b15a91f9f5ff390071545e
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 26 10:14:42 2012 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Mon Mar 26 12:04:43 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=c8b13641

Parser&Walker: improve escaped double quote handling

---
 bashast/bashast.g              |    3 ++-
 bashast/gunit/fname.gunit      |    2 +-
 bashast/libbashWalker.g        |    1 +
 scripts/command_execution.bash |    1 +
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bashast/bashast.g b/bashast/bashast.g
index c836047..f7ce358 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -784,7 +784,7 @@ ns_string_part
 	|OTHER|EQUALS|PCT|PCTPCT|PLUS|MINUS|DOT|DOTDOT|COLON
 	|TILDE|LSQUARE|RSQUARE|CARET|POUND|COMMA|EXPORT|LOCAL|AT
 	// Escaped characters
-	|ESC_RPAREN|ESC_LPAREN|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK
+	|ESC_RPAREN|ESC_LPAREN|ESC_DOLLAR|ESC_GT|ESC_LT|ESC_TICK|ESC_DQUOTE
 	// The following is for filename expansion
 	|TIMES|QMARK;
 
@@ -1126,6 +1126,7 @@ AMP_RSHIFT	:	'&>>';
 SEMIC	:	';';
 DOUBLE_SEMIC	:	';;';
 PIPE	:	'|';
+ESC_DQUOTE	:	'\\"';
 DQUOTE	:	'"' { if(LA(-1) != '\\') double_quoted = !double_quoted; };
 SQUOTE	:	{ double_quoted }? => '\'';
 SINGLE_QUOTED_STRING_TOKEN	:	{ !double_quoted }? => '\'' .* '\'';

diff --git a/bashast/gunit/fname.gunit b/bashast/gunit/fname.gunit
index 9ac0b25..65bb614 100644
--- a/bashast/gunit/fname.gunit
+++ b/bashast/gunit/fname.gunit
@@ -77,4 +77,4 @@ condition_expr:
 "[[ x == ab!(gh|i) ]]" -> (KEYWORD_TEST (MATCH_PATTERN (STRING x) (STRING ab (EXTENDED_MATCH_NONE (BRANCH gh) (BRANCH i)))))
 
 double_quoted_string:
-"\"\\\\\"\$\`\"" -> (DOUBLE_QUOTED_STRING \ " \$ \`)
+"\"\\\\\"\$\`\"" -> (DOUBLE_QUOTED_STRING \ \" \$ \`)

diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g
index 5d5b557..fb1ca55 100644
--- a/bashast/libbashWalker.g
+++ b/bashast/libbashWalker.g
@@ -446,6 +446,7 @@ options {backtrack = true;}
 	:ESC_RPAREN { $libbash_value = ")"; }
 	|ESC_LPAREN { $libbash_value = "("; }
 	|ESC_DOLLAR { $libbash_value = "$"; }
+	|ESC_DQUOTE { $libbash_value = "\""; }
 	|ESC_GT { $libbash_value = ">"; }
 	|ESC_LT { $libbash_value = "<"; }
 	|ESC_TICK { $libbash_value = "`"; }

diff --git a/scripts/command_execution.bash b/scripts/command_execution.bash
index 89a0ed7..58f1279 100644
--- a/scripts/command_execution.bash
+++ b/scripts/command_execution.bash
@@ -89,3 +89,4 @@ echo "${!variable// /_}"
 echo "${!#// /_}"
 echo "${!1// /_}"
 echo "${!variable// /$'\n'}"
+eval abc+=\( \"\$@\" \)



             reply	other threads:[~2012-06-03  9:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-03  9:08 Petteri Räty [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-06-03  9:08 [gentoo-commits] proj/libbash:master commit in: scripts/, bashast/, bashast/gunit/ Petteri Räty
2012-06-03  9:08 Petteri Räty
2012-06-03  9:08 Petteri Räty
2012-06-03  9:08 Petteri Räty
2011-08-04 13:53 Petteri Räty
2011-08-04 13:53 Petteri Räty
2011-08-04 13:53 Petteri Räty
2011-08-04 13:53 Petteri Räty
2011-06-09  8:15 Petteri Räty
2011-06-09  7:27 Petteri Räty
2011-05-22 21:00 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=1332763483.c8b13641610f4f6b37b15a91f9f5ff390071545e.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