diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-03-16 22:06:32 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-03-20 21:32:02 -0700 |
commit | 1305c02579a3b4976ddbd964cf174b71a36b8e41 (patch) | |
tree | 5cb9a605826d33c46e8747b36e79746116145986 /parse_execution.cpp | |
parent | 2c19ca0dbf8c4875f92f50359f3d15b0c7e5eeaf (diff) |
Rewrite parser_t::current_line() to respect new parser
Diffstat (limited to 'parse_execution.cpp')
-rw-r--r-- | parse_execution.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/parse_execution.cpp b/parse_execution.cpp index 0dfb85a0..127309a8 100644 --- a/parse_execution.cpp +++ b/parse_execution.cpp @@ -1590,3 +1590,17 @@ int parse_execution_context_t::get_current_line_number() } return line_number; } + +int parse_execution_context_t::get_current_source_offset() const +{ + int result = -1; + if (executing_node_idx != NODE_OFFSET_INVALID) + { + const parse_node_t &node = tree.at(executing_node_idx); + if (node.has_source()) + { + result = static_cast<int>(node.source_start); + } + } + return result; +} |