diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index 050d01891..1c6741df5 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -241,7 +241,6 @@ parse_execution_result_t parse_execution_context_t::run_if_statement( tnode_t statement) { // Push an if block. if_block_t *ib = parser->push_block(); - ib->node_offset = this->get_offset(*statement); parse_execution_result_t result = parse_execution_success; @@ -536,7 +535,6 @@ parse_execution_result_t parse_execution_context_t::run_while_statement( tnode_t header, tnode_t contents) { // Push a while block. while_block_t *wb = parser->push_block(); - wb->node_offset = this->get_offset(header); parse_execution_result_t ret = parse_execution_success; diff --git a/src/parser.cpp b/src/parser.cpp index 9017a120c..77818e131 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -802,17 +802,7 @@ void parser_t::get_backtrace(const wcstring &src, const parse_error_list_t &erro } } -block_t::block_t(block_type_t t) - : block_type(t), - skip(false), - tok_pos(), - node_offset(NODE_OFFSET_INVALID), - loop_status(LOOP_NORMAL), - job(), - src_filename(), - src_lineno(), - wants_pop_env(false), - event_blocks() {} +block_t::block_t(block_type_t t) : block_type(t) {} block_t::~block_t() {} diff --git a/src/parser.h b/src/parser.h index edb51dcf6..7c061a2c3 100644 --- a/src/parser.h +++ b/src/parser.h @@ -75,31 +75,26 @@ struct block_t { public: /// Whether execution of the commands in this block should be skipped. - bool skip; - /// The start index of the block. - int tok_pos; - /// Offset of the node. - node_offset_t node_offset; + bool skip{false}; /// Status for the current loop block. Can be any of the values from the loop_status enum. - enum loop_status_t loop_status; + enum loop_status_t loop_status { LOOP_NORMAL }; /// The job that is currently evaluated in the specified block. - shared_ptr job; + shared_ptr job{}; /// Name of file that created this block. This string is intern'd. - const wchar_t *src_filename; + const wchar_t *src_filename{nullptr}; /// Line number where this block was created. - int src_lineno; + int src_lineno{0}; /// Whether we should pop the environment variable stack when we're popped off of the block /// stack. - bool wants_pop_env; + bool wants_pop_env{false}; + /// List of event blocks. + event_blockage_list_t event_blocks{}; block_type_t type() const { return this->block_type; } /// Description of the block, for debugging. wcstring description() const; - /// List of event blocks. - event_blockage_list_t event_blocks; - /// Destructor virtual ~block_t(); };