From 55f930aa7e55302e6c9772fa06c4fff18c1b5eba Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 19 Aug 2023 21:29:54 +0200 Subject: [PATCH] [ruby/yarp] Use node kind for Ruby types * For example in ProgramNode: # attr_reader statements: Node => # attr_reader statements: StatementsNode https://github.com/ruby/yarp/commit/ffed35238c --- yarp/templates/template.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yarp/templates/template.rb b/yarp/templates/template.rb index 68df4524f7..75c337d7b8 100755 --- a/yarp/templates/template.rb +++ b/yarp/templates/template.rb @@ -23,6 +23,10 @@ module KindTypes end end + def ruby_type + options[:kind] || "Node" + end + def java_type options[:kind] || "Node" end @@ -42,7 +46,7 @@ class NodeParam < Param include KindTypes def rbs_class - "Node" + ruby_type end end @@ -52,7 +56,7 @@ class OptionalNodeParam < Param include KindTypes def rbs_class - "Node?" + "#{ruby_type}?" end end