Class: Estreet::BreakStatement

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

Direct Known Subclasses

ContinueStatement

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(label = nil, loc = nil) ⇒ BreakStatement

Returns a new instance of BreakStatement.



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

def initialize(label=nil, loc=nil)
  super(loc)
  @label = Identifier.new(label) if label
end

Instance Method Details

#attributesObject



8
9
10
# File 'lib/estreet/break_statement.rb', line 8

def attributes
  super.merge(label: @label)
end