You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a little more investigation with irb, and I think my conclusion is that the tree-sitter CST would need to be context-sensitive in order to represent programs consistently with mruby:
irb(main):001:0> x = [0, 1, 2]
=> [0, 1, 2]
irb(main):002:0> x [0]
=> 0
irb(main):003:0> def y(z)
irb(main):004:1> z
irb(main):005:1> end
=> :y
irb(main):006:0> y [0]
=> [0]
irb(main):007:0> x [0] == 0
=> true
irb(main):008:0> y [0] == 0
=> false
irb(main):009:0> y [0] == [0]
=> true
One suggestion here would be to completely collapse element referencing with method invocation.
While investigating #146 , I discovered that the tree for a comparison of an indexed object appears incorrect.
Consider the following program:
tree-sitter-ruby will emit the following CST:
That is, this is interpreted as equivalent to:
whereas Ruby evaluates this as:
This can be confirmed by running
which prints
true
.I believe the correct CST should be:
The text was updated successfully, but these errors were encountered: