Sha256: 9fd002559383f1904f6e91e89956cbb0d4f50d6ef3b52e3e99cd3761d47c3216

Contents?: true

Size: 834 Bytes

Versions: 38

Compression:

Stored size: 834 Bytes

Contents

%%{
  machine re_property;

  property_char     = [pP];

  property_sequence = property_char . '{' . '^'? (alnum|space|[_\-\.=])+ '}';

  action premature_property_end {
    raise PrematureEndError.new('unicode property')
  }

  # Unicode properties scanner
  # --------------------------------------------------------------------------
  unicode_property := |*

    property_sequence < eof(premature_property_end) {
      text = text(data, ts, te, 1).first
      type = (text[1] == 'P') ^ (text[3] == '^') ? :nonproperty : :property

      name = data[ts+2..te-2].pack('c*').gsub(/[\^\s_\-]/, '').downcase

      token = self.class.short_prop_map[name] || self.class.long_prop_map[name]
      raise UnknownUnicodePropertyError.new(name) unless token

      self.emit(type, token.to_sym, text, ts-1, te)

      fret;
    };
  *|;
}%%

Version data entries

38 entries across 33 versions & 6 rubygems

Version Path
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/lib/regexp_parser/scanner/property.rl
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/lib/regexp_parser/scanner/property.rl
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/scanner/property.rl
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/scanner/property.rl
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/scanner/property.rl
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/scanner/property.rl
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.8.2/lib/regexp_parser/scanner/property.rl
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.2/lib/regexp_parser/scanner/property.rl
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.8.2/lib/regexp_parser/scanner/property.rl
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.2/lib/regexp_parser/scanner/property.rl
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.8.2/lib/regexp_parser/scanner/property.rl
regexp_parser-1.8.2 lib/regexp_parser/scanner/property.rl
regexp_parser-1.8.1 lib/regexp_parser/scanner/property.rl
regexp_parser-1.8.0 lib/regexp_parser/scanner/property.rl
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.7.1/lib/regexp_parser/scanner/property.rl
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.7.1/lib/regexp_parser/scanner/property.rl
tdiary-5.1.3 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.7.0/lib/regexp_parser/scanner/property.rl
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/regexp_parser-1.7.1/lib/regexp_parser/scanner/property.rl
regexp_parser-1.7.1 lib/regexp_parser/scanner/property.rl
tdiary-5.1.2 vendor/bundle/ruby/2.7.0/gems/regexp_parser-1.7.0/lib/regexp_parser/scanner/property.rl