diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-03-16 16:45:00 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-03-20 21:32:02 -0700 |
commit | 3cfdc6d1269df5c5e198dea88a851682e9d09133 (patch) | |
tree | 2c94b9faa650ddcb79c674266be9208dbb6b05c7 /parse_execution.h | |
parent | 8ec73b2dd40bf95d2b665cfb4cc22c26a2717cae (diff) |
Fix line number reporting in new parser
Diffstat (limited to 'parse_execution.h')
-rw-r--r-- | parse_execution.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/parse_execution.h b/parse_execution.h index 91c32c99..be04c1b6 100644 --- a/parse_execution.h +++ b/parse_execution.h @@ -107,13 +107,16 @@ private: parse_execution_result_t run_job_list(const parse_node_t &job_list_node, const block_t *associated_block); parse_execution_result_t populate_job_from_job_node(job_t *j, const parse_node_t &job_node, const block_t *associated_block); + /* Returns the line number of the node at the given index, indexed from 0. Not const since it touches cached_lineno_offset */ + int line_offset_of_node_at_offset(node_offset_t idx); + public: parse_execution_context_t(const parse_node_tree_t &t, const wcstring &s, parser_t *p, int initial_eval_level); /* Returns the current eval level */ int current_eval_level() const { return eval_level; } - /* Returns the current line number. Not const since it touches cached_lineno_offset */ + /* Returns the current line number, indexed from 1. Not const since it touches cached_lineno_offset */ int get_current_line_number(); /* Start executing at the given node offset. Returns 0 if there was no error, 1 if there was an error */ |