aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bashast/libbashWalker.g7
-rw-r--r--scripts/command_execution.bash3
2 files changed, 7 insertions, 3 deletions
diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g
index 9157574..0c21ccd 100644
--- a/bashast/libbashWalker.g
+++ b/bashast/libbashWalker.g
@@ -736,18 +736,19 @@ argument[std::vector<std::string>& args, bool split]
}
};
-logic_command_list
+logic_command
@declarations {
bool logic_and;
}
- :command
- |^((LOGICAND { logic_and = true; } | LOGICOR { logic_and = false; }) command {
+ : ^((LOGICAND { logic_and = true; } | LOGICOR { logic_and = false; }) logic_command_list {
if(logic_and ? !walker->get_status() : walker->get_status())
command(ctx);
else
seek_to_next_tree(ctx);
});
+logic_command_list: command | logic_command;
+
command_list: ^(LIST logic_command_list+);
compound_command
diff --git a/scripts/command_execution.bash b/scripts/command_execution.bash
index 58f1279..4c04908 100644
--- a/scripts/command_execution.bash
+++ b/scripts/command_execution.bash
@@ -17,6 +17,9 @@ false && echo "wrong"
false || echo "right"
true ||
echo "wrong"
+echo right1 && echo right2 && false && echo wrong
+false || echo right3 || echo wrong
+true && false || echo right4 && echo right5
echo "end"
: ${DEFAULTED:="yes"}
FOO="abc" echo "command environment"