mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:01:12 -03:00
Adopt new parser in tab completions
This commit is contained in:
@@ -224,6 +224,12 @@ class parse_node_t
|
||||
else
|
||||
return wcstring(str, this->source_start, this->source_length);
|
||||
}
|
||||
|
||||
/* Returns whether the given location is within the source range or at its end */
|
||||
bool location_in_or_at_end_of_source_range(size_t loc) const
|
||||
{
|
||||
return has_source() && source_start <= loc && loc - source_start <= source_length;
|
||||
}
|
||||
};
|
||||
|
||||
/* Statement decorations. This matches the order of productions in decorated_statement */
|
||||
@@ -254,6 +260,9 @@ class parse_node_tree_t : public std::vector<parse_node_t>
|
||||
/* Finds the last node of a given type underneath a given node, or NULL if it could not be found. If parent is NULL, this finds the last node in the tree of that type. */
|
||||
const parse_node_t *find_last_node_of_type(parse_token_type_t type, const parse_node_t *parent = NULL) const;
|
||||
|
||||
/* Finds a node containing the given source location */
|
||||
const parse_node_t *find_node_matching_source_location(parse_token_type_t type, size_t source_loc, const parse_node_t *parent) const;
|
||||
|
||||
/* Indicate if the given argument_list or arguments_or_redirections_list is a root list, or has a parent */
|
||||
bool argument_list_is_root(const parse_node_t &node) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user