From b6af3e51abd54963948d5523ce01459fadedebbf Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 23 Dec 2013 14:53:56 -0800 Subject: Very early work in adopting new parser for actual execution of commands. Not turned on yet. --- parser.h | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'parser.h') diff --git a/parser.h b/parser.h index 8ee2fb82..fab73acf 100644 --- a/parser.h +++ b/parser.h @@ -96,37 +96,16 @@ public: bool had_command; /**< Set to non-zero once a command has been executed in this block */ int tok_pos; /**< The start index of the block */ - /** - Status for the current loop block. Can be any of the values from the loop_status enum. - */ + /** Status for the current loop block. Can be any of the values from the loop_status enum. */ int loop_status; - /** - The job that is currently evaluated in the specified block. - */ + /** The job that is currently evaluated in the specified block. */ job_t *job; -#if 0 - union - { - int while_state; /**< True if the loop condition has not yet been evaluated*/ - wchar_t *for_variable; /**< Name of the variable to loop over */ - int if_state; /**< The state of the if block, can be one of IF_STATE_UNTESTED, IF_STATE_FALSE, IF_STATE_TRUE */ - wchar_t *switch_value; /**< The value to test in a switch block */ - const wchar_t *source_dest; /**< The name of the file to source*/ - event_t *event; /**&, bool); int parse_job(process_t *p, job_t *j, tokenizer_t *tok); @@ -399,6 +386,9 @@ public: */ int eval(const wcstring &cmdStr, const io_chain_t &io, enum block_type_t block_type); int eval2(const wcstring &cmd_str, const io_chain_t &io, enum block_type_t block_type); + + void execute_job_list(node_offset_t idx, const parser_context_t &ctx); + void execute_next(std::vector *execution_stack, const parser_context_t &ctx); /** Evaluate line as a list of parameters, i.e. tokenize it and perform parameter expansion and cmdsubst execution on the tokens. -- cgit v1.2.3