File: parser.rb

package info (click to toggle)
ruby-tomlrb 2.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 136 kB
  • sloc: ruby: 1,090; yacc: 229; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 345 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen-string-literal: true

require 'tomlrb/generated_parser'

class Tomlrb::Parser < Tomlrb::GeneratedParser

  def initialize(tokenizer, **options)
    @tokenizer = tokenizer
    @handler   = Tomlrb::Handler.new(**options)
    super()
  end

  def next_token
    @tokenizer.next_token
  end

  def parse
    do_parse
    @handler
  end
end