[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
This commit is contained in:
Benoit Daloze 2023-08-19 21:29:54 +02:00 committed by git
parent 725ca2f9d8
commit 55f930aa7e

View File

@ -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