Class: Furnace::AVM2::Tokens::TernaryOperatorToken

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

Instance Method Summary collapse

Methods included from IsComplex

#complex?

Instance Method Details

#to_structureObject



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

def to_structure
  structurize "... ? ... : ..."
end

#to_textObject



5
6
7
# File 'lib/furnace-avm2/source/implementation_tokens/ternary_operator_token.rb', line 5

def to_text
  "#{@children[0].to_text} ? #{@children[1].to_text} : #{@children[2].to_text}"
end