mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 09:27:38 +00:00
Remove the index parameter from parser_t::is_function
It was always 0 in practice.
This commit is contained in:
parent
8bed818039
commit
bad1b84513
2 changed files with 3 additions and 4 deletions
|
@ -416,9 +416,8 @@ wcstring parser_t::stack_trace() const {
|
|||
/// NULL otherwise. This is tested by moving down the block-scope-stack, checking every block if it
|
||||
/// is of type FUNCTION_CALL. If the caller doesn't specify a starting position in the stack we
|
||||
/// begin with the current block.
|
||||
const wchar_t *parser_t::is_function(size_t idx) const {
|
||||
for (size_t block_idx = idx; block_idx < block_list.size(); block_idx++) {
|
||||
const block_t &b = block_list[block_idx];
|
||||
const wchar_t *parser_t::is_function() const {
|
||||
for (const auto &b : block_list) {
|
||||
if (b.is_function_call()) {
|
||||
return b.function_name.c_str();
|
||||
} else if (b.type() == block_type_t::source) {
|
||||
|
|
|
@ -285,7 +285,7 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
|
|||
/// Returns the name of the currently evaluated function if we are currently evaluating a
|
||||
/// function, null otherwise. This is tested by moving down the block-scope-stack, checking
|
||||
/// every block if it is of type FUNCTION_CALL.
|
||||
const wchar_t *is_function(size_t idx = 0) const;
|
||||
const wchar_t *is_function() const;
|
||||
|
||||
/// Create a parser.
|
||||
parser_t();
|
||||
|
|
Loading…
Reference in a new issue