1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_dispatch/journey/parser_extras.rb
Aaron Patterson aaaa67902e pull up path parsing
`add_route` needs the AST, so rather than shove it in a hash and delete
later, lets move parsing up the stack so we can pass down later
2015-08-14 10:39:33 -07:00

27 lines
502 B
Ruby

require 'action_dispatch/journey/scanner'
require 'action_dispatch/journey/nodes/node'
module ActionDispatch
module Journey # :nodoc:
class Parser < Racc::Parser # :nodoc:
include Journey::Nodes
def self.parse(string)
new.parse string
end
def initialize
@scanner = Scanner.new
end
def parse(string)
@scanner.scan_setup(string)
do_parse
end
def next_token
@scanner.next_token
end
end
end
end