diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-09-01 01:46:14 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-09-01 01:46:14 -0700 |
commit | cc1395797e78a26583461333199181b4f8ec0b13 (patch) | |
tree | 9f191547887932abe9e6a34d27349085453ed622 /parser.h | |
parent | 122791646ec7dc421a679cb39cce7a8cbc0a7594 (diff) |
First stab at elseif implementation
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 */ |