forked from Mirrors/helix
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3e84434c69
`deepest_preceding` is known to be a descendant of `node`. Repeated calls of `Node::parent` _should_ eventually turn `deepest_preceding` into `node`, but when the node is errored (the tree contains a syntax error), `Node::parent` returns None. In the typescript case: if(true) &&true // ^ press enter here The tree is: (program [0, 0] - [1, 0] (if_statement [0, 0] - [0, 15] condition: (parenthesized_expression [0, 2] - [0, 8] (true [0, 3] - [0, 7])) consequence: (expression_statement [0, 8] - [0, 15] (binary_expression [0, 8] - [0, 15] left: (identifier [0, 8] - [0, 8]) right: (true [0, 11] - [0, 15]))))) `node` is the `program` node and `deepest_preceding` is the `binary_expression`. The tree is errored on the `binary_expression` node with `(MISSING identifier [0, 8] - [0, 8])`. In the C++ case: ; << // press enter after the ';' The tree is: (translation_unit [0, 0] - [1, 0] (expression_statement [0, 0] - [0, 1]) (ERROR [0, 1] - [0, 4] (identifier [0, 1] - [0, 1]))) `node` is the `translation_unit` and `deepest_preceding` is the `ERROR` node. In both cases, `Node::parent` on the errored node returns None. |
2 years ago | |
---|---|---|
.. | ||
increment | 2 years ago | |
auto_pairs.rs | 2 years ago | |
chars.rs | 3 years ago | |
comment.rs | 2 years ago | |
config.rs | 3 years ago | |
diagnostic.rs | 2 years ago | |
diff.rs | 3 years ago | |
graphemes.rs | 3 years ago | |
history.rs | 2 years ago | |
indent.rs | 2 years ago | |
lib.rs | 2 years ago | |
line_ending.rs | 2 years ago | |
macros.rs | 4 years ago | |
match_brackets.rs | 3 years ago | |
movement.rs | 2 years ago | |
object.rs | 2 years ago | |
path.rs | 2 years ago | |
position.rs | 2 years ago | |
register.rs | 2 years ago | |
search.rs | 3 years ago | |
selection.rs | 2 years ago | |
shellwords.rs | 2 years ago | |
surround.rs | 2 years ago | |
syntax.rs | 2 years ago | |
test.rs | 2 years ago | |
textobject.rs | 2 years ago | |
transaction.rs | 2 years ago | |
wrap.rs | 3 years ago |