diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2020-01-03 00:02:28 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2020-01-03 00:02:28 +0900 |
commit | bba491612283e5e2b3a05f578350f84ce02274bc (patch) | |
tree | 123ddf4db0adf036a7b367df5bcd39c1d3733e54 /ast.rb | |
parent | 749915e9407f3d623ab817f60a8ac85085e44695 (diff) |
Fix example of node.type [ci skip]
```
% docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'root = RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
p [root, root.type]
call = root.children[2]
p [call, call.type]
'
ruby-2.6.0 [#<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>, :SCOPE]
[#<RubyVM::AbstractSyntaxTree::Node:LASGN@1:0-1:9>, :LASGN]
...
ruby-2.7.0 [#<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>, :SCOPE]
[#<RubyVM::AbstractSyntaxTree::Node:LASGN@1:0-1:9>, :LASGN]
```
Diffstat (limited to 'ast.rb')
-rw-r--r-- | ast.rb | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -84,7 +84,7 @@ class RubyVM # root = RubyVM::AbstractSyntaxTree.parse("x = 1 + 2") # root.type # => :SCOPE # call = root.children[2] - # call.type # => :OPCALL + # call.type # => :LASGN def type __builtin_ast_node_type end |