Skip to content

Commit 3817c5f

Browse files
committed
Wording fixes
1 parent d7f4f08 commit 3817c5f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

docs/parser.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ end
1717

1818
As opposed to other languages, core constructs like `def`, `if` and `for` are not
1919
particularly special either, since they are itself regular functions (or macros rather).
20-
Consequently they can be used "improperly" in a quoted expression, as shown above.
20+
As a result, these constructs can be used "improperly" in a quoted expression, as shown above.
2121

2222
Consequently, to correctly parse all Elixir code, we need the AST to closely match
2323
the Elixir AST. See [Elixir / Syntax reference](https://hexdocs.pm/elixir/syntax-reference.html)
2424
for more details.
2525

26-
Whenever possible possible, we try using a more specific nodes (like binary/unary operator),
27-
but only to the extent that doesn't lose on generality. To get a sense of what the AST looks
28-
like, have a look at the tests in `test/corpus/`.
26+
Whenever possible, we try using a more specific nodes (like binary/unary operator), but only
27+
to the extent that doesn't lose on generality. To get a sense of what the AST looks like, have
28+
a look at the tests in `test/corpus/`.
2929
3030
## Getting started with Tree-sitter
3131
@@ -155,9 +155,6 @@ a +b
155155
In the first three expressions `+` is a binary operator, while in the last one
156156
`+` is an unary operator referring to local call argument.
157157
158-
To correctly tokenize all the cases, we have a special `_before_unary_operator` empty
159-
token and use external scanner to tokenize
160-
161158
To correctly tokenize all cases we use external scanner to tokenize a special empty
162159
token (`_before_unary_operator`) when the spacing matches `a +b`, which forces the
163160
parser to pick the unary operator path.
@@ -166,7 +163,7 @@ parser to pick the unary operator path.
166163
167164
The `not in` operator may have an arbitrary inline whitespace between `not` and `in`.
168165
169-
We cannot use a regular expressoin like `/not[ \t]+in/`, because it would also match
166+
We cannot use a regular expression like `/not[ \t]+in/`, because it would also match
170167
in expressions like `a not inn` as the longest matching token.
171168
172169
A possible solution could be `seq("not", "in")` with dynamic conflict resolution, but

0 commit comments

Comments
 (0)