aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2012-03-01 16:30:32 +0800
committerMu Qiao <qiaomuf@gentoo.org>2012-03-01 16:30:32 +0800
commit19f82f9686e67da79b9f265f8baf228223d069b4 (patch)
tree24737721c0c2095b0938bfb3d5632f88156e3831 /bashast/gunit/array.gunit
parentParser: allow empty replacement pattern (diff)
downloadlibbash-19f82f9686e67da79b9f265f8baf228223d069b4.tar.gz
libbash-19f82f9686e67da79b9f265f8baf228223d069b4.tar.bz2
libbash-19f82f9686e67da79b9f265f8baf228223d069b4.zip
Parser: Allow EOLs in builtin array definition
Diffstat (limited to 'bashast/gunit/array.gunit')
-rw-r--r--bashast/gunit/array.gunit12
1 files changed, 12 insertions, 0 deletions
diff --git a/bashast/gunit/array.gunit b/bashast/gunit/array.gunit
index ddfdfeb..1958836 100644
--- a/bashast/gunit/array.gunit
+++ b/bashast/gunit/array.gunit
@@ -34,6 +34,18 @@ variable_definition_atom:
builtin_variable_definitions:
"asdf=(a b c d) ade acd=bde" -> (LIST (COMMAND (VARIABLE_DEFINITIONS (= asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d))) (EQUALS ade (STRING (VAR_REF ade))) (= acd (STRING bde)))))
+builtin_variable_definition_item:
+"local cmakeargs=(
+ abc
+ def
+ ghi
+)" -> "local cmakeargs = ( \n abc \n def \n ghi \n )"
+"export cmakeargs=(
+ abc
+ def
+ ghi
+)" -> "export cmakeargs = ( \n abc \n def \n ghi \n )"
+
variable_reference:
"$asdf" -> (VAR_REF asdf)
"${asdf[0]:-default}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL (asdf (ARITHMETIC 0)) (STRING default)))