Class: Estreet::ExpressionStatement

Inherits:
Statement show all
Defined in:
lib/estreet/expression_statement.rb

Instance Attribute Summary

Attributes inherited from Node

#source_location

Instance Method Summary collapse

Methods inherited from Statement

#<<, #to_statement

Methods inherited from Node

#as_json, #loc, #type

Constructor Details

#initialize(expr, loc = nil) ⇒ ExpressionStatement

Returns a new instance of ExpressionStatement.



3
4
5
6
7
# File 'lib/estreet/expression_statement.rb', line 3

def initialize(expr, loc=nil)
  super(loc)

  @expr = expr.to_expression
end

Instance Method Details

#attributesObject



9
10
11
# File 'lib/estreet/expression_statement.rb', line 9

def attributes
  super.merge(expression: @expr)
end