module Regexp::Scanner
def self.emit_options(text, ts, te)
def self.emit_options(text, ts, te) if text =~ /\(\?([mixdau]+)?-?([mix]+)?:/ positive, negative = $1, $2 if positive =~ /x/ @free_spacing = true end # If the x appears in both, treat it like ruby does, the second cancels # the first. if negative =~ /x/ @free_spacing = false end end @in_options = true @spacing_stack << [@free_spacing, @group_depth] emit(:group, :options, text, ts, te) end