Class: Hocon::Impl::Tokenizer::TokenIterator::WhitespaceSaver

Inherits:
Object
  • Object
show all
Defined in:
lib/hocon/impl/tokenizer.rb

Instance Method Summary collapse

Constructor Details

#initializeWhitespaceSaver

Returns a new instance of WhitespaceSaver.



55
56
57
58
# File 'lib/hocon/impl/tokenizer.rb', line 55

def initialize
  @whitespace = StringIO.new
  @last_token_was_simple_value = false
end

Instance Method Details

#add(c) ⇒ Object



60
61
62
# File 'lib/hocon/impl/tokenizer.rb', line 60

def add(c)
  @whitespace << c
end

#check(t, base_origin, line_number) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/hocon/impl/tokenizer.rb', line 64

def check(t, base_origin, line_number)
  if TokenIterator.simple_value?(t)
    next_is_a_simple_value(base_origin, line_number)
  else
    next_is_not_a_simple_value(base_origin, line_number)
  end
end