17
17
18
18
As opposed to other languages, core constructs like `def `, `if ` and `for ` are not
19
19
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.
21
21
22
22
Consequently , to correctly parse all Elixir code, we need the AST to closely match
23
23
the Elixir AST . See [Elixir / Syntax reference](https: // hexdocs.pm/ elixir/ syntax- reference.html)
24
24
for more details.
25
25
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/`.
29
29
30
30
## Getting started with Tree-sitter
31
31
155
155
In the first three expressions `+` is a binary operator, while in the last one
156
156
`+` is an unary operator referring to local call argument.
157
157
158
- To correctly tokenize all the cases, we have a special `_before_unary_operator` empty
159
- token and use external scanner to tokenize
160
-
161
158
To correctly tokenize all cases we use external scanner to tokenize a special empty
162
159
token (`_before_unary_operator`) when the spacing matches `a +b`, which forces the
163
160
parser to pick the unary operator path.
@@ -166,7 +163,7 @@ parser to pick the unary operator path.
166
163
167
164
The `not in` operator may have an arbitrary inline whitespace between `not` and `in`.
168
165
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
170
167
in expressions like `a not inn` as the longest matching token.
171
168
172
169
A possible solution could be `seq("not", "in")` with dynamic conflict resolution, but
0 commit comments