Method: RuboCop::Ext::RegexpNode#assign_properties

Defined in:
lib/rubocop/ext/regexp_node.rb

#assign_propertiesObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rubocop/ext/regexp_node.rb', line 18

def assign_properties(*)
  super

  str = with_interpolations_blanked
  @parsed_tree = begin
    Regexp::Parser.parse(str, options: options)
  rescue StandardError
    nil
  end
  origin = loc.begin.end
  @parsed_tree&.each_expression(true) { |e| e.origin = origin }
end