js_regex 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1bbeda384bb83dd9b39b33ee86480fa141022ec
4
- data.tar.gz: 2eeeaca9c685d8c92e5a48a931f03f8b425b0815
3
+ metadata.gz: 3d910abcbfe22ab6a470b8784025da0d81a7d823
4
+ data.tar.gz: 8a30eddfc5efe71a598afe7064f3a0ee944e017e
5
5
  SHA512:
6
- metadata.gz: bac0e45b453e993934fdbba21b4d32594aa13b56fe71f690d328e7ee2d0e97c31e68866dca7c0c46173acad6360a7c9e4b1310f5e03cf646ad7f4efd82e061b5
7
- data.tar.gz: 1b46ead6c027d017a2a6790ed6e45004b85c4386e27423d6dda38c1bb96f6a7d93207e162c27829ec2befd2da7c6be19574c7625c95cb2f7887306c4fb1fcaff
6
+ metadata.gz: 031334a1f4d48e5f432cb6bfada63eb2821b61d8d2c8e052548c98db0f5a8fd83f606305c00976c51c6e6f1caaa6f0def2c0f405914a4daa694c2606b92a5c25
7
+ data.tar.gz: eb7be820e5112f488fa69326e4870a0f9ac8d4538138c41d83e201551a8aa2a2cfe36ca5cba18e944a5a89a0fd25fc8783306062bea7017f1fddbb559d1fb299
@@ -19,6 +19,8 @@ class JsRegex
19
19
  :dot,
20
20
  :eol,
21
21
  :form_feed,
22
+ :group_close,
23
+ :group_open,
22
24
  :hex,
23
25
  :interval_close,
24
26
  :interval_open,
@@ -35,6 +37,8 @@ class JsRegex
35
37
 
36
38
  def convert_data
37
39
  case subtype
40
+ when :codepoint_list
41
+ convert_codepoint_list
38
42
  when :literal
39
43
  LiteralConverter.convert_data(data)
40
44
  when *ESCAPES_SHARED_BY_RUBY_AND_JS
@@ -44,6 +48,14 @@ class JsRegex
44
48
  warn_of_unsupported_feature
45
49
  end
46
50
  end
51
+
52
+ def convert_codepoint_list
53
+ elements = data.scan(/\h+/).map do |codepoint|
54
+ literal = Regexp.escape([codepoint.hex].pack('U'))
55
+ LiteralConverter.convert_data(literal)
56
+ end
57
+ elements.join
58
+ end
47
59
  end
48
60
  end
49
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class JsRegex
4
- VERSION = '1.2.2'
4
+ VERSION = '1.2.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_regex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janosch Müller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: regexp_parser