aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-07-22 21:51:34 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-08-02 15:52:18 +0800
commitbad292ded893e93c6d598d85fb111c05ffd599e5 (patch)
tree897a9a1a841a528d36cc3668621c2442fdeb9d57 /bashast
parentParser: improve here document and here string (diff)
downloadlibbash-bad292ded893e93c6d598d85fb111c05ffd599e5.tar.gz
libbash-bad292ded893e93c6d598d85fb111c05ffd599e5.tar.bz2
libbash-bad292ded893e93c6d598d85fb111c05ffd599e5.zip
Parser: fix single quoted string in command sub
Diffstat (limited to 'bashast')
-rw-r--r--bashast/bashast.g1
-rw-r--r--bashast/gunit/command_sub.gunit1
2 files changed, 2 insertions, 0 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g
index 39e6d54..c987375 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -1076,6 +1076,7 @@ COMMAND_SUBSTITUTION_PAREN
return;
}
}
+ | SINGLE_QUOTED_STRING_TOKEN
| .
)+
));
diff --git a/bashast/gunit/command_sub.gunit b/bashast/gunit/command_sub.gunit
index 9998893..4b7b776 100644
--- a/bashast/gunit/command_sub.gunit
+++ b/bashast/gunit/command_sub.gunit
@@ -24,3 +24,4 @@ command_substitution:
"$(CONTROL= command arg )" -> (COMMAND_SUB $(CONTROL= command arg ))
"`cat output.log |grep error|cut`" -> (COMMAND_SUB `cat output.log |grep error|cut`)
"$(function foo() { echo 'hello'; }; foo)" -> (COMMAND_SUB $(function foo() { echo 'hello'; }; foo))
+"$(sed -n 's/^OUTPUT_FORMAT(\"\([^\"]*\)\",.*/\1/p')" OK