Class: Hjson::AST::NumberParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/hjson/ast/number_parser.rb

Instance Attribute Summary collapse

Attributes inherited from Parser

#buffer, #options, #source

Instance Method Summary collapse

Methods inherited from Parser

declare, declared_vars, #parse, parser, parsers, rule

Constructor Details

#initialize(payload, **options) ⇒ NumberParser

Returns a new instance of NumberParser.



56
57
58
59
60
61
62
63
# File 'lib/hjson/ast/number_parser.rb', line 56

def initialize(payload, **options)
  @source    = payload
  @buffer    = StringScanner.new(source)
  @payload   = ''
  @leading   = true
  @zero_size = 0
  @options   = options
end

Instance Attribute Details

#leadingObject

Returns the value of attribute leading.



6
7
8
# File 'lib/hjson/ast/number_parser.rb', line 6

def leading
  @leading
end

#payloadObject

Returns the value of attribute payload.



6
7
8
# File 'lib/hjson/ast/number_parser.rb', line 6

def payload
  @payload
end

#zero_sizeObject

Returns the value of attribute zero_size.



6
7
8
# File 'lib/hjson/ast/number_parser.rb', line 6

def zero_size
  @zero_size
end