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

Inherits:
Node
  • Object
show all
Defined in:
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?

Constructor Details

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

Instance Method Details

#typeObject



100
101
102
# File 'lib/rspec/support/source/node.rb', line 100

def type
  :_expression_sequence
end