aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bashast/bashast.g6
-rw-r--r--bashast/gunit/pipeline.gunit1
-rw-r--r--scripts/var_def.bash2
3 files changed, 6 insertions, 3 deletions
diff --git a/bashast/bashast.g b/bashast/bashast.g
index 55c469a..799b1cf 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -272,7 +272,7 @@ command_separator
| AMP^
| EOL!;
pipeline
- : time? ((BANG) => (BANG BLANK!))? command^ (BLANK!? PIPE^ BLANK!? command)*;
+ : time? ((BANG) => (BANG BLANK!))? command^ (BLANK!? PIPE^ wspace!? command)*;
time
: TIME^ BLANK! ((time_posix) => time_posix)?;
@@ -431,8 +431,8 @@ variable_definition_atom
-> ^(EQUALS ^(name explicit_arithmetic) string_expr?)
| name EQUALS value? -> ^(EQUALS name value?)
| name PLUS EQUALS array_value -> ^(PLUS_ASSIGN name array_value)
- | name PLUS EQUALS string_expr_part?
- -> ^(EQUALS name ^(STRING ^(VAR_REF name) string_expr_part?));
+ | name PLUS EQUALS string_expr_part*
+ -> ^(EQUALS name ^(STRING ^(VAR_REF name) string_expr_part*));
value
: string_expr
| array_value;
diff --git a/bashast/gunit/pipeline.gunit b/bashast/gunit/pipeline.gunit
index b97ec3b..4a3a4f4 100644
--- a/bashast/gunit/pipeline.gunit
+++ b/bashast/gunit/pipeline.gunit
@@ -30,3 +30,4 @@ pipeline:
echo \"three\"
fi" -> (COMMAND (IF_STATEMENT (if (LIST (COMMAND (STRING cat) time)) (LIST (COMMAND (STRING echo) (STRING (DOUBLE_QUOTED_STRING three)))))))
"i=1 j=2" -> (COMMAND (VARIABLE_DEFINITIONS (= i (STRING 1)) (= j (STRING 2))))
+"cat foo |\ncat" -> (| (COMMAND (STRING cat) (STRING foo)) (COMMAND (STRING cat)))
diff --git a/scripts/var_def.bash b/scripts/var_def.bash
index dc47b6c..b3ffca7 100644
--- a/scripts/var_def.bash
+++ b/scripts/var_def.bash
@@ -82,6 +82,8 @@ FOO005=abc
echo $FOO005
FOO005+=def
echo $FOO005
+FOO005+=-foo-bar
+echo $FOO005
function foo() {
local -i foo=1
local -a bar=(1 2 3)