Commit 38147f5
committed
Fix
Problem: If a class declare the not-equal operator `!=`, the parsing
is wrong. For instance, the folowing program:
class A
def !=(other); end
end
is parsed as if the method `!` was a defined with the body expression
syntax leading to the following tree:
(program [0, 0] - [3, 0]
(class [0, 0] - [1, 20]
name: (constant [0, 6] - [0, 7])
body: (body_statement [1, 2] - [1, 16]
(method [1, 2] - [1, 15]
name: (operator [1, 6] - [1, 7])
body: (parenthesized_statements [1, 8] - [1, 15]
(identifier [1, 9] - [1, 14])))))
(identifier [2, 0] - [2, 3]))
Solution: Declare `!=` as a possible operator definition.!= operator definition1 parent 0ffe457 commit 38147f5
File tree
4 files changed
+133831
-133686
lines changed- src
- test/corpus
4 files changed
+133831
-133686
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1025 | 1025 | | |
1026 | 1026 | | |
1027 | 1027 | | |
1028 | | - | |
| 1028 | + | |
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments