Class: JSON::Spec::Parser

Inherits:
Pure::Parser
  • Object
show all
Defined in:
lib/jsss/parser.rb

Constant Summary collapse

DATA_TYPE =
/[A-Z][a-z]*/
ELIPSIS =
/\.\.\./

Instance Method Summary collapse

Instance Method Details

#parse_stringObject



10
11
12
13
14
15
16
# File 'lib/jsss/parser.rb', line 10

def parse_string
  if scan(DATA_TYPE)
    self[0].intern
  else
    super
  end
end

#parse_valueObject



18
19
20
21
22
23
24
25
# File 'lib/jsss/parser.rb', line 18

def parse_value
  case
  when skip(ELIPSIS)
    :more
  else
    super
  end
end