aboutsummaryrefslogtreecommitdiffstats
path: root/ast.rb
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2020-01-03 00:02:28 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2020-01-03 00:02:28 +0900
commitbba491612283e5e2b3a05f578350f84ce02274bc (patch)
tree123ddf4db0adf036a7b367df5bcd39c1d3733e54 /ast.rb
parent749915e9407f3d623ab817f60a8ac85085e44695 (diff)
downloadruby-bba491612283e5e2b3a05f578350f84ce02274bc.tar.gz
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.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ast.rb b/ast.rb
index 1fedf76649..d7e9df8678 100644
--- a/ast.rb
+++ b/ast.rb
@@ -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