aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-09-01 01:46:14 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-09-01 01:46:14 -0700
commitcc1395797e78a26583461333199181b4f8ec0b13 (patch)
tree9f191547887932abe9e6a34d27349085453ed622 /parser.h
parent122791646ec7dc421a679cb39cce7a8cbc0a7594 (diff)
First stab at elseif implementation
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/parser.h b/parser.h
index 4c1cd7f5..31f08b7b 100644
--- a/parser.h
+++ b/parser.h
@@ -99,7 +99,7 @@ struct block_t
The job that is currently evaluated in the specified block.
*/
job_t *job;
-
+
#if 0
union
{
@@ -141,8 +141,18 @@ struct block_t
struct if_block_t : public block_t
{
bool if_expr_evaluated; // whether the clause of the if statement has been tested
- bool if_expr_result; // if so, whether it evaluated to true
+ bool any_branch_taken; // whether the clause of the if statement or any elseif has been found to be true
+ bool is_elseif_entry; // whether we're the first command in an elseif.
bool else_evaluated; // whether we've encountered a terminal else block
+
+ enum {
+ if_state_if,
+ if_state_elseif,
+ if_state_else
+ } if_state;
+
+ bool has_reached_else() const { return if_state == if_state_else; }
+
if_block_t();
};
@@ -229,7 +239,6 @@ enum while_status
;
-
/**
Errors that can be generated by the parser
*/