Skip to content

Commit

Permalink
RubyVM super node handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
castwide committed Apr 26, 2020
1 parent bafc97e commit 3a84364
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/solargraph/parser/legacy/node_chainer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def generate_links n
elsif n.type == :zsuper
result.push Chain::ZSuper.new('super', @in_block || block_passed?(n))
elsif n.type == :super
# elsif [:super, :zsuper].include?(n.type)
args = n.children.map { |c| NodeChainer.chain(c) }
result.push Chain::Call.new('super', args, @in_block || block_passed?(n))
elsif n.type == :const
Expand Down
6 changes: 4 additions & 2 deletions lib/solargraph/parser/rubyvm/node_chainer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ def generate_links n
result.push Chain::Call.new(n.children[0].to_s, node_to_argchains(n.children[1]), @in_block || block_passed?(n))
elsif n.type == :SELF
result.push Chain::Head.new('self')
elsif [:SUPER, :ZSUPER].include?(n.type)
result.push Chain::Head.new('super')
elsif n.type == :ZSUPER
result.push Chain::ZSuper.new('super', @in_block || block_passed?(n))
elsif n.type == :SUPER
result.push Chain::Call.new('super', node_to_argchains(n.children.last), @in_block || block_passed?(n))
elsif [:COLON2, :COLON3, :CONST].include?(n.type)
const = unpack_name(n)
result.push Chain::Constant.new(const)
Expand Down

0 comments on commit 3a84364

Please sign in to comment.