module Regexp::Parser
def self.parse(input, syntax = :any, &block)
def self.parse(input, syntax = :any, &block) @nesting = [@root = @node = Root.new] Regexp::Lexer.scan(input, syntax) do |token| self.parse_token token end if block_given? block.call @root else @root end end