aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2023-08-19 21:29:54 +0200
committergit <svn-admin@ruby-lang.org>2023-08-20 17:32:57 +0000
commit55f930aa7e55302e6c9772fa06c4fff18c1b5eba (patch)
tree736820781927861f9da149bf24b752754b36d093
parent725ca2f9d808d180c57eaf49c2dd6bfcb9f701e4 (diff)
downloadruby-55f930aa7e55302e6c9772fa06c4fff18c1b5eba.tar.gz
[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
-rwxr-xr-xyarp/templates/template.rb8
1 files 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