diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-03 01:06:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-03 01:06:34 +0000 |
commit | afa685398e6c098a55bb2d0565e8f1bd380e4ab9 (patch) | |
tree | 4a37b0f466328af12c4b9a0e8f403c0ccf8b497c /lib/pp.rb | |
parent | 8edd642381e6f5b53dd45de641aadc4bebee1603 (diff) | |
download | ruby-afa685398e6c098a55bb2d0565e8f1bd380e4ab9.tar.gz |
Refine RubyVM::AbstractSyntaxTree::Node#type
* ast.c (rb_ast_node_type): simplified to return a Symbol without
"NODE_" prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/pp.rb')
-rw-r--r-- | lib/pp.rb | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -529,13 +529,13 @@ class RubyVM::AbstractSyntaxTree::Node end def pretty_print(q) - q.group(1, "(#{type.sub(/\ANODE_/,'')}@#{first_lineno}:#{first_column}-#{last_lineno}:#{last_column}", ")") { + q.group(1, "(#{type}@#{first_lineno}:#{first_column}-#{last_lineno}:#{last_column}", ")") { case type - when "NODE_SCOPE" + when :SCOPE pretty_print_children(q, %w"tbl args body") - when "NODE_ARGS" + when :ARGS pretty_print_children(q, %w[pre_num pre_init opt first_post post_num post_init rest kw kwrest block]) - when "NODE_DEFN" + when :DEFN pretty_print_children(q, %w[mid body]) else pretty_print_children(q) |