mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
fix typos in syntax.md
This commit is contained in:
parent
66bcdcbb36
commit
7c6c812a74
1 changed files with 2 additions and 2 deletions
|
@ -195,7 +195,7 @@ Modeling this with immutable trees is possible, but annoying.
|
|||
A function green tree is not super-convenient to use.
|
||||
The biggest problem is accessing parents (there are no parent pointers!).
|
||||
But there are also "identify" issues.
|
||||
Let's say you want to write a code which builds a list of expressions in a file: `fn collect_exrepssions(file: GreenNode) -> HashSet<GreenNode>`.
|
||||
Let's say you want to write a code which builds a list of expressions in a file: `fn collect_expressions(file: GreenNode) -> HashSet<GreenNode>`.
|
||||
For the input like
|
||||
|
||||
```rust
|
||||
|
@ -236,7 +236,7 @@ impl SyntaxNode {
|
|||
self.parent.clone()
|
||||
}
|
||||
fn children(&self) -> impl Iterator<Item = SyntaxNode> {
|
||||
let mut offset = self.offset
|
||||
let mut offset = self.offset;
|
||||
self.green.children().map(|green_child| {
|
||||
let child_offset = offset;
|
||||
offset += green_child.text_len;
|
||||
|
|
Loading…
Reference in a new issue