summaryrefslogtreecommitdiff
path: root/lib/pp.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-03 01:06:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-03 01:06:34 +0000
commitafa685398e6c098a55bb2d0565e8f1bd380e4ab9 (patch)
tree4a37b0f466328af12c4b9a0e8f403c0ccf8b497c /lib/pp.rb
parent8edd642381e6f5b53dd45de641aadc4bebee1603 (diff)
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.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pp.rb b/lib/pp.rb
index bb504bc1b4..ad0391c012 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -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)