Class: Furnace::AVM2::Tokens::ScopeToken

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

Instance Method Summary collapse

Instance Method Details

#text_afterObject



11
12
13
14
15
16
17
18
19
# File 'lib/furnace-avm2/source/declaration_tokens/scope_token.rb', line 11

def text_after
  if @options[:continuation]
    "} "
  elsif @options[:closure]
    "}"
  else
    "}\n"
  end
end

#text_beforeObject



3
4
5
6
7
8
9
# File 'lib/furnace-avm2/source/declaration_tokens/scope_token.rb', line 3

def text_before
  if @options[:function]
    " {\n"
  else
    "{\n"
  end
end

#to_textObject



21
22
23
# File 'lib/furnace-avm2/source/declaration_tokens/scope_token.rb', line 21

def to_text
  "#{text_before}#{indent(children.map(&:to_text).join, @options)}#{text_after}"
end