Class: Furnace::Code::SeparatedToken

Inherits:
SurroundedToken show all
Defined in:
lib/furnace/code/separated_token.rb

Instance Attribute Summary

Attributes inherited from NonterminalToken

#children

Attributes inherited from Token

#origin

Instance Method Summary collapse

Methods inherited from SurroundedToken

#text_after, #text_before

Methods inherited from NonterminalToken

#initialize

Methods inherited from Token

#initialize, #subscribe, type, #type, #unsubscribe

Constructor Details

This class inherits a constructor from Furnace::Code::NonterminalToken

Instance Method Details

#text_betweenObject



4
5
6
# File 'lib/furnace/code/separated_token.rb', line 4

def text_between
  ""
end

#to_structure(options = {}) ⇒ Object



12
13
14
# File 'lib/furnace/code/separated_token.rb', line 12

def to_structure(options={})
  structurize "#{text_before} #{([text_between] * 3).join(" ")} #{text_after}", options
end

#to_textObject



8
9
10
# File 'lib/furnace/code/separated_token.rb', line 8

def to_text
  "#{text_before}#{children.map(&:to_text).join(text_between)}#{text_after}"
end