class Regexp::Parser
def parse_token(token)
def parse_token(token) case token.type when :anchor; anchor(token) when :assertion, :group; group(token) when :backref; backref(token) when :conditional; conditional(token) when :escape; escape(token) when :free_space; free_space(token) when :keep; keep(token) when :literal; literal(token) when :meta; meta(token) when :posixclass, :nonposixclass; posixclass(token) when :property, :nonproperty; property(token) when :quantifier; quantifier(token) when :set; set(token) when :type; type(token) else raise UnknownTokenTypeError.new(token.type, token) end close_completed_character_set_range end