Class: Furnace::AVM2::Tokens::CaseToken

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

Instance Method Summary collapse

Constructor Details

#initialize(origin, value, options) ⇒ CaseToken

Returns a new instance of CaseToken.



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

def initialize(origin, value, options)
  super(origin, [ value ], options)
  @value = value
end

Instance Method Details

#text_afterObject



16
17
18
# File 'lib/furnace-avm2/source/implementation_tokens/case_token.rb', line 16

def text_after
  ":\n"
end

#text_beforeObject



8
9
10
11
12
13
14
# File 'lib/furnace-avm2/source/implementation_tokens/case_token.rb', line 8

def text_before
  if @value
    "case "
  else
    "default"
  end
end