Class: RSpec::Support::Source::ExpressionSequenceNode

Inherits:
Node
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-support-3.12.0/lib/rspec/support/source/node.rb

Overview

Basically ‘Ripper.sexp` generates arrays whose first element is a symbol (type of sexp), but it exceptionally generates typeless arrays for expression sequence:

Ripper.sexp(‘foo; bar’)

> [

  :program,
  [ # Typeless array
    [:vcall, [:@ident, "foo", [1, 0]]],
    [:vcall, [:@ident, "bar", [1, 5]]]
  ]
]

We wrap typeless arrays in this pseudo type node so that it can be handled in the same way as other type node.

Instance Attribute Summary

Attributes inherited from Node

#parent, #sexp

Instance Method Summary collapse

Methods inherited from Node

#args, #children, #each, #each_ancestor, #initialize, #inspect, #location, sexp?

Methods included from Enumerable

#as_json, #compact_blank, #exclude?, #excluding, #in_order_of, #including, #index_by, #index_with, #many?, #maximum, #minimum, #pick, #pluck, #sole, #sum

Constructor Details

This class inherits a constructor from RSpec::Support::Source::Node

Instance Method Details

#typeObject



98
99
100
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-support-3.12.0/lib/rspec/support/source/node.rb', line 98

def type
  :_expression_sequence
end