Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Corrects minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon committed Jul 5, 2019
1 parent 52a93ff commit 0bcd41c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions using-babelfish/babelfish-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can read [the server](https://github.com/bblfsh/sdk/blob/94e3b212553e761677d

### ParseRequest

Issued by the client to request that a source code file must be parsed to an UAST tree. The client must provide the code in the `content` field, the programming language in the `language` field \(which must be one of the [languages currently supported](../languages.md)\) or empty to enable auto-detection\) and the `filename` field with the name of the file containing the source code.
Issued by the client to request that a source code file must be parsed to an UAST tree. The client must provide the code in the `content` field, the programming language in the `language` field \(which must be one of the [languages currently supported](../languages.md) or empty to enable auto-detection\) and the `filename` field with the name of the file containing the source code.

Example:

Expand Down Expand Up @@ -52,4 +52,3 @@ The status contains the return code of the Request. If it's != 0 \(which will be
"roles": ["role1", "role2", ...]
}
```

2 changes: 1 addition & 1 deletion using-babelfish/clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ When using one of the clients that support libuast you can query the UAST result

## Iterators

The client also allow you to instance an Iterator object and iterate over the tree on several predefined orders:
The client also allows you to instance an Iterator object and iterate over the tree on several predefined orders:

* [Pre-Order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order)
* [Post-Order](https://en.wikipedia.org/wiki/Tree_traversal#Post-order)
Expand Down
3 changes: 1 addition & 2 deletions using-babelfish/grpc-usage-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Now that we've created a request, we need to send it \(previous code omitted\):

The code in the previous section returned a `ParseResponse` object that will have the format of the [ParseResponse](babelfish-protocol.md#ParseResponse) as seen on the [server protocol](babelfish-protocol.md) page. You should check the `status` \(`Status` in the case of Go, since public members start with uppercase\); only a value of `protocol.Status.OK` will indicate success.

The most important member of the `ParseResponse` object is undoubtly `uast` \(`UAST` in Go\). This will contain a `Node` object which the [structure detailed in the previous page](babelfish-protocol.md#Nodes). This first node returned would be the root node of the UAST, and you typically would iterate over the node children \(contained in the aptly named `children` field\) typically using [a visitor](https://en.wikipedia.org/wiki/Visitor_pattern) and reading the `token`s and `roles` in the tree to do your tool.
The most important member of the `ParseResponse` object is undoubtedly `uast` \(`UAST` in Go\). This will contain a `Node` object with the [structure detailed in the previous page](babelfish-protocol.md#Nodes). This first node returned would be the root node of the UAST, and you typically would iterate over the children node \(contained in the aptly named `children` field\) typically using [a visitor](https://en.wikipedia.org/wiki/Visitor_pattern) and reading the `token`s and `role`s in the tree to do your tool.

For demonstration purposes, we'll just write a simple function that iterates the tree in preorder and print the node tokens:

Expand Down Expand Up @@ -132,4 +132,3 @@ func printTokens(n *uast.Node) {
}
}
```

0 comments on commit 0bcd41c

Please sign in to comment.