mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +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.
|
A function green tree is not super-convenient to use.
|
||||||
The biggest problem is accessing parents (there are no parent pointers!).
|
The biggest problem is accessing parents (there are no parent pointers!).
|
||||||
But there are also "identify" issues.
|
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
|
For the input like
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
@ -236,7 +236,7 @@ impl SyntaxNode {
|
||||||
self.parent.clone()
|
self.parent.clone()
|
||||||
}
|
}
|
||||||
fn children(&self) -> impl Iterator<Item = SyntaxNode> {
|
fn children(&self) -> impl Iterator<Item = SyntaxNode> {
|
||||||
let mut offset = self.offset
|
let mut offset = self.offset;
|
||||||
self.green.children().map(|green_child| {
|
self.green.children().map(|green_child| {
|
||||||
let child_offset = offset;
|
let child_offset = offset;
|
||||||
offset += green_child.text_len;
|
offset += green_child.text_len;
|
||||||
|
|
Loading…
Reference in a new issue