From afa685398e6c098a55bb2d0565e8f1bd380e4ab9 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 3 Dec 2018 01:06:34 +0000 Subject: 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 --- lib/pp.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/pp.rb') 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) -- cgit v1.2.3