class SyntaxTree::Parser
def on_regexp_literal(regexp_content, ending)
(nil | RegexpEnd) ending
RegexpContent regexp_content,
on_regexp_literal: (
:call-seq:
def on_regexp_literal(regexp_content, ending) location = regexp_content.location if ending.nil? message = "Cannot find expected regular expression ending" raise ParseError.new(message, *find_token_error(location)) end RegexpLiteral.new( beginning: regexp_content.beginning, ending: ending.value, parts: regexp_content.parts, location: location.to(ending.location) ) end