Class: Furnace::AVM2::Tokens::DoWhileToken

Inherits:
Code::NonterminalToken
  • Object
show all
Defined in:
lib/furnace-avm2/source/implementation_tokens/do_while_token.rb

Instance Method Summary collapse

Constructor Details

#initialize(origin, body, condition, options = {}) ⇒ DoWhileToken

Returns a new instance of DoWhileToken.



3
4
5
6
# File 'lib/furnace-avm2/source/implementation_tokens/do_while_token.rb', line 3

def initialize(origin, body, condition, options={})
  super(origin, [body, condition], options)
  @condition, @body = condition, body
end

Instance Method Details

#to_structure(options = {}) ⇒ Object



12
13
14
# File 'lib/furnace-avm2/source/implementation_tokens/do_while_token.rb', line 12

def to_structure(options={})
  structurize "do ... while(...)", options
end

#to_textObject



8
9
10
# File 'lib/furnace-avm2/source/implementation_tokens/do_while_token.rb', line 8

def to_text
  "do #{@body.to_text}while(#{@condition.to_text});\n"
end