class JsRegex::Converter::PropertyConverter

Template class implementation.

Uses the `character_set` and `regexp_property_values` gems to get the codepoints matched by the property and build a set string from them.

Private Instance Methods

convert_data() click to toggle source
# File lib/js_regex/converter/property_converter.rb, line 15
def convert_data
  content = CharacterSet.of_expression(expression)

  if expression.case_insensitive? && !context.case_insensitive_root
    content = content.case_insensitive
  elsif !expression.case_insensitive? && context.case_insensitive_root
    warn_of_unsupported_feature('nested case-sensitive property')
  end

  content.to_s_with_surrogate_ranges
end