diff --git a/src/builtin_functions.cpp b/src/builtin_functions.cpp index 969b929ec..cc20bc2dd 100644 --- a/src/builtin_functions.cpp +++ b/src/builtin_functions.cpp @@ -144,7 +144,7 @@ static int report_function_metadata(const wchar_t *funcname, bool verbose, io_st int line_number = 0; if (function_exists(funcname, parser)) { - auto props = function_get_properties(funcname); + auto props = function_get_props(funcname); path = function_get_definition_file(funcname); if (path) { autoloaded = function_is_autoloaded(funcname) ? L"autoloaded" : L"not-autoloaded"; diff --git a/src/exec.cpp b/src/exec.cpp index c30b8f61c..ee1873fec 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -657,7 +657,7 @@ static proc_performer_t get_performer_for_process(process_t *p, job_t *job, }; } else { assert(p->type == process_type_t::function); - auto props = function_get_properties(p->argv0()); + auto props = function_get_props(p->argv0()); if (!props) { FLOGF(error, _(L"Unknown function '%ls'"), p->argv0()); return proc_performer_t{}; diff --git a/src/function.cpp b/src/function.cpp index e20e26ff6..c7ff951ee 100644 --- a/src/function.cpp +++ b/src/function.cpp @@ -158,7 +158,7 @@ void function_add(wcstring name, std::shared_ptr props) { (void)ins; } -function_properties_ref_t function_get_properties(const wcstring &name) { +function_properties_ref_t function_get_props(const wcstring &name) { if (parser_keywords_is_reserved(name)) return nullptr; return function_set.acquire()->get_props(name); } @@ -204,7 +204,7 @@ void function_remove(const wcstring &name) { } bool function_get_definition(const wcstring &name, wcstring &out_definition) { - auto props = function_get_properties(name); + auto props = function_get_props(name); if (!props) return false; // We want to preserve comments that the AST attaches to the header (#5285). @@ -221,7 +221,7 @@ bool function_get_definition(const wcstring &name, wcstring &out_definition) { } bool function_get_desc(const wcstring &name, wcstring &out_desc) { - if (auto props = function_get_properties(name)) { + if (auto props = function_get_props(name)) { out_desc = _(props->description.c_str()); return true; } @@ -279,14 +279,14 @@ wcstring_list_t function_get_names(int get_hidden) { } const wchar_t *function_get_definition_file(const wcstring &name) { - if (auto func = function_get_properties(name)) { + if (auto func = function_get_props(name)) { return func->definition_file; } return nullptr; } bool function_is_autoloaded(const wcstring &name) { - if (auto func = function_get_properties(name)) { + if (auto func = function_get_props(name)) { return func->is_autoload; } return false; @@ -353,7 +353,7 @@ wcstring functions_def(const wcstring &name) { out.append(esc_desc); } - auto props = function_get_properties(name); + auto props = function_get_props(name); assert(props && "Should have function properties"); if (!props->shadow_scope) { out.append(L" --no-scope-shadowing"); diff --git a/src/function.h b/src/function.h index 9fb341e19..63835debe 100644 --- a/src/function.h +++ b/src/function.h @@ -57,8 +57,8 @@ void function_add(wcstring name, std::shared_ptr props); /// Remove the function with the specified name. void function_remove(const wcstring &name); -/// Returns the properties for a function, or nullptr if none. This does not trigger autoloading. -function_properties_ref_t function_get_properties(const wcstring &name); +/// \return the properties for a function, or nullptr if none. This does not trigger autoloading. +function_properties_ref_t function_get_props(const wcstring &name); /// Returns by reference the definition of the function with the name \c name. Returns true if /// successful, false if no function with the given name exists.