Stop storing is_breakpoint inside the parser

This can also be trivially computed from the block list.
This commit is contained in:
ridiculousfish
2021-07-28 13:44:44 -07:00
parent b914c94cc1
commit 789261a40c
4 changed files with 14 additions and 19 deletions

View File

@@ -169,9 +169,6 @@ struct library_data_t {
/// Whether we are running a subshell command.
bool is_subshell{false};
/// Whether we are running due to a `breakpoint` command.
bool is_breakpoint{false};
/// Whether we are running an event handler. This is not a bool because we keep count of the
/// event nesting level.
int is_event{0};
@@ -341,6 +338,9 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
/// This supports 'status is-block'.
bool is_block() const;
/// \return whether we have a breakpoint block.
bool is_breakpoint() const;
/// Returns the block at the given index. 0 corresponds to the innermost block. Returns nullptr
/// when idx is at or equal to the number of blocks.
const block_t *block_at_index(size_t idx) const;