aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_execution.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-28 16:33:26 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-28 16:33:26 -0800
commitc632307eaa4fdd8ac09bb1a9bf031101b1e0b6a2 (patch)
treed6dd1f9ca612e2ef2eb9b3ec08300eedfd3c3ddb /parse_execution.cpp
parent0f9de11a67a5bbf3fe0c3be7f55cb25a7987ed4d (diff)
Make eval_node_at_offset return an error indication instead of the exit
status of the last command
Diffstat (limited to 'parse_execution.cpp')
-rw-r--r--parse_execution.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/parse_execution.cpp b/parse_execution.cpp
index 72d4452c..4201c288 100644
--- a/parse_execution.cpp
+++ b/parse_execution.cpp
@@ -1013,25 +1013,25 @@ int parse_execution_context_t::eval_node_at_offset(node_offset_t offset, const b
node.type == symbol_if_statement ||
node.type == symbol_switch_statement);
- int ret = 1;
+ int status = 1;
switch (node.type)
{
case symbol_job_list:
/* We should only get a job list if it's the very first node. This is because this is the entry point for both top-level execution (the first node) and INTERNAL_BLOCK_NODE execution (which does block statements, but never job lists) */
assert(offset == 0);
- ret = this->run_job_list(node, associated_block);
+ status = this->run_job_list(node, associated_block);
break;
case symbol_block_statement:
- ret = this->run_block_statement(node);
+ status = this->run_block_statement(node);
break;
case symbol_if_statement:
- ret = this->run_if_statement(node);
+ status = this->run_if_statement(node);
break;
case symbol_switch_statement:
- ret = this->run_switch_statement(node);
+ status = this->run_switch_statement(node);
break;
default:
@@ -1040,5 +1040,11 @@ int parse_execution_context_t::eval_node_at_offset(node_offset_t offset, const b
PARSER_DIE();
break;
}
+
+ proc_set_last_status(status);
+
+ /* Argh */
+ int ret = errors.empty() ? 0 : 1;
+ errors.clear();
return ret;
}