fix typos in syntax.md

This commit is contained in:
Jakob Hellermann 2020-11-17 15:16:52 +01:00 committed by GitHub
parent 66bcdcbb36
commit 7c6c812a74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;