Class: Siren::Parser
Constant Summary collapse
- ESCAPEE =
{ '"' => '"', '\\' => '\\', '/' => '/', 'b' => '\b', 'f' => '\f', 'n' => '\n', 'r' => '\r', 't' => '\t' }
Instance Attribute Summary collapse
-
#at ⇒ Object
readonly
The index of the current character.
-
#ch ⇒ Object
readonly
The index of the current character.
Instance Method Summary collapse
Methods included from Walker
Instance Attribute Details
#at ⇒ Object (readonly)
The index of the current character
19 20 21 |
# File 'lib/siren/parser.rb', line 19 def at @at end |
#ch ⇒ Object (readonly)
The index of the current character
19 20 21 |
# File 'lib/siren/parser.rb', line 19 def ch @ch end |
Instance Method Details
#parse(source, &reviver) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/siren/parser.rb', line 22 def parse(source, &reviver) @text = source.dup @at, @ch = 0, ' ' result = value! white! error! "Syntax error" if @ch walk(result, &reviver) end |