|
| bool | ast_equal_ignoring_location (const nlohmann::json &a, const nlohmann::json &b) |
| bool | ast_location_key (const std::string &k) |
| bool | ast_objects_equal_ignoring_location (const nlohmann::json &a, const nlohmann::json &b) |
| bool | ast_arrays_equal_ignoring_location (const nlohmann::json &a, const nlohmann::json &b) |
| bool | ast_contains_call (const nlohmann::json &n) |
| | True for X = Y between two bare names, such as _Elem = int.
|
| bool | is_name_alias (const nlohmann::json &stmt) |
| std::string | dotted_to_path (const std::string &module_name) |
| | Convert a dotted Python module name to a filesystem path segment.
|
| template<typename JsonType> |
| bool | search_function_in_ast (const JsonType &node, const std::string &func_name) |
| template<typename JsonType> |
| JsonType | find_class (const JsonType &ast_json, const std::string &class_name) |
| template<class Json> |
| Json | find_attr_annotation (const Json &class_node, const std::string &attr) |
| | The annotation of self.
|
| template<class Json> |
| std::size_t | count_attr_stores (const Json &node, const std::string &attr, bool non_self_only) |
| | Counts the stores and deletions of <obj>.
|
| template<class Json> |
| std::string | constructed_attr_class (const Json &class_node, const std::string &attr) |
| | C when the __init__ of class_node holds self.
|
| template<typename JsonType> |
| bool | is_property_def (const JsonType &function_def) |
| template<typename JsonType> |
| bool | any_class_has_property (const JsonType &ast_body, const std::string &name) |
| template<typename JsonType> |
| bool | any_class_defines_method (const JsonType &node, const std::string &name) |
| | True when a class anywhere under node defines a method named name.
|
| template<typename JsonType> |
| bool | is_property_method (const JsonType &ast_body, const std::string &class_name, const std::string &method_name) |
| template<typename JsonType> |
| bool | class_defines_method (const JsonType &ast_body, const std::string &class_name, const std::string &method_name) |
| | True when class_name or one of its (transitive) base classes defines a method named method_name.
|
| template<typename JsonType> |
| std::size_t | count_class_defs (const JsonType &node) |
| | Counts every ClassDef under node, at any depth.
|
| template<typename JsonType> |
| unsigned | count_function_scope_classes (const JsonType &body, const std::string &class_name, bool in_function=false) |
| | Counts the ClassDef nodes named class_name that sit inside a function body under body.
|
| template<typename JsonType> |
| void | collect_class_definition_lines (const JsonType &node, const std::string &class_name, std::vector< int > &lines) |
| | Source lines of every ClassDef named class_name under node that the converter registers: at any scope except directly inside a class body.
|
| template<typename JsonType> |
| bool | is_class (const std::string &name, const JsonType &ast_json) |
| template<typename JsonType> |
| bool | is_module (const std::string &module_name, const JsonType &ast) |
| template<typename JsonType> |
| JsonType | try_find_function (const JsonType &json, const std::string &func_name) |
| | Returns an empty JsonType on a miss. Never throws.
|
| template<typename JsonType> |
| JsonType & | find_function_or_throw (JsonType &json, const std::string &func_name) |
| | Throws std::runtime_error on a miss.
|
| template<typename JsonType> |
| bool | is_imported_from (const JsonType &ast, const std::string &module, const std::string &entity) |
| | True when from <module> import <entity> appears at the AST top level.
|
| template<typename JsonType> |
| const JsonType & | find_imported_function (const JsonType &ast, const std::string &func_name) |
| std::string | dotted_name (const nlohmann::json &node) |
| | The dotted name a Name or Attribute node spells, e.g. "collections.abc.Set".
|
| std::string | resolve_import (const nlohmann::json &ast, const std::string &name) |
| | What dotted name denotes through the module's imports, e.g.
|
| std::string | collections_abc_class (const nlohmann::json &ast, const std::string &name) |
| | The collections.abc class that dotted name denotes, or empty.
|
| template<typename JsonType> |
| const std::string | get_object_alias (const JsonType &ast, const std::string &obj_name) |
| template<typename JsonType> |
| const JsonType | get_var_node (const std::string &var_name, const JsonType &block) |
| std::vector< std::string > | split_function_path (const std::string &function) |
| template<typename JsonType> |
| const JsonType * | class_method_scope (const JsonType &body, std::string &name) |
| template<typename JsonType> |
| JsonType | find_function_by_path (const JsonType &ast, const std::vector< std::string > &path) |
| template<typename JsonType> |
| JsonType | find_var_in_function (const std::string &var_name, const JsonType &func_node) |
| template<typename JsonType> |
| const JsonType | find_var_decl (const std::string &var_name, const std::string &function, const JsonType &ast) |
| template<typename JsonType> |
| std::string | get_annotation_type_name (const JsonType &annotation) |
| std::vector< std::string > | split_top_level_params (const std::string &s) |
| | Split a rendered parameter list on commas that are not inside brackets, trimming each part.
|
| template<typename JsonType> |
| std::string | render_annotation_type (const JsonType &annotation) |
| | The full generic spelling of an annotation node, e.g.
|
| template<typename JsonType> |
| const JsonType | get_var_value (const std::string &var_name, const std::string &function, const JsonType &ast) |
| std::size_t | binds_by_field (const nlohmann::json &node, const std::string &kind, const std::string &name) |
| std::size_t | count_name_bindings (const nlohmann::json &node, const std::string &name) |
| const nlohmann::json * | top_level_value (const nlohmann::json &module, const std::string &name) |
| template<typename JsonType> |
| bool | has_multiple_assignments_in_block (const std::string &var_name, const JsonType &block) |
| template<typename JsonType> |
| bool | has_multiple_assignments_in_scope (const std::string &var_name, const std::string &function, const JsonType &ast) |
| template<typename JsonType> |
| bool | extract_constant_integer (const JsonType &node, const std::string &function, const JsonType &ast, long long &value) |
| template<typename JsonType> |
| const JsonType | get_list_element (const JsonType &list_value, int pos) |
| template<typename JsonType> |
| const JsonType | find_return_node (const JsonType &block) |
| std::string | extract_var_name_from_symbol_id (const std::string &symbol_id) |
| | Extract the variable name from a symbol identifier Examples: "py:test.py@l" -> "l" "py:test.py@F@foo@x" -> "x" "py:test.py@C@MyClass@F@method@var" -> "var".
|
| template<typename JsonType> |
| JsonType | build_char_sequence_node (const char *kind, const std::string &chars, const JsonType &loc_src) |
| template<typename JsonType> |
| bool | has_overload_decorator (const JsonType &func_node) |
| template<typename JsonType> |
| std::string | imported_function_return_type (const std::string &name, const JsonType &ast_json) |
| | The declared return-type name of a function name defined in a module this AST imports, or "" if there is none.
|
| void | collect_return_values (const nlohmann::json &node, std::vector< nlohmann::json > &values) |