diff options
| author | Benoit Daloze <eregontp@gmail.com> | 2024-02-28 18:51:45 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-02-28 18:30:44 +0000 |
| commit | 2143789a3311f70f28dbbd6921ca9a42f47bea80 (patch) | |
| tree | 890ae477413033c3752b2cdee497cdc2e26d4d0b | |
| parent | 1b0a5bcb0a63f9e0f2473ab7bccdeae9fc52bb6c (diff) | |
[ruby/prism] Make NodeKindField subclass NodeKindField
* To avoid duplication.
https://github.com/ruby/prism/commit/12e5aae0b4
| -rwxr-xr-x | prism/templates/template.rb | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/prism/templates/template.rb b/prism/templates/template.rb index 79292ab691..e0081612b1 100755 --- a/prism/templates/template.rb +++ b/prism/templates/template.rb @@ -145,7 +145,7 @@ module Prism # This represents a field on a node that is a list of nodes. We pass them as # references and store them directly on the struct. - class NodeListField < Field + class NodeListField < NodeKindField def rbs_class if specific_kind "Array[#{specific_kind}]" @@ -161,20 +161,7 @@ module Prism end def java_type - if specific_kind - "#{specific_kind}[]" - else - "Node[]" - end - end - - # TODO: unduplicate with NodeKindField - def specific_kind - options[:kind] unless options[:kind].is_a?(Array) - end - - def union_kind - options[:kind] if options[:kind].is_a?(Array) + "#{super}[]" end end |
