js_regex 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/js_regex/conversion.rb +82 -0
- data/lib/js_regex/converter/anchor_converter.rb +24 -0
- data/lib/js_regex/converter/assertion_converter.rb +27 -0
- data/lib/js_regex/converter/base.rb +44 -0
- data/lib/js_regex/converter/conditional_converter.rb +24 -0
- data/lib/js_regex/converter/context.rb +63 -0
- data/lib/js_regex/converter/escape_converter.rb +27 -0
- data/lib/js_regex/converter/freespace_converter.rb +16 -0
- data/lib/js_regex/converter/group_converter.rb +81 -0
- data/lib/js_regex/converter/literal_converter.rb +29 -0
- data/lib/js_regex/converter/meta_converter.rb +28 -0
- data/lib/js_regex/converter/nonproperty_converter.rb +18 -0
- data/lib/js_regex/converter/property_converter.rb +40 -0
- data/lib/js_regex/converter/quantifier_converter.rb +37 -0
- data/lib/js_regex/converter/set_converter.rb +137 -0
- data/lib/js_regex/converter/subset_converter.rb +10 -0
- data/lib/js_regex/converter/type_converter.rb +26 -0
- data/lib/js_regex/converter/unsupported_token_converter.rb +16 -0
- data/lib/js_regex/property_map.rb +330 -0
- data/lib/js_regex.rb +26 -0
- metadata +107 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
class JsRegex
|
2
|
+
#
|
3
|
+
module Converter
|
4
|
+
require_relative 'base'
|
5
|
+
#
|
6
|
+
# Template class implementation.
|
7
|
+
#
|
8
|
+
class TypeConverter < JsRegex::Converter::Base
|
9
|
+
HEX_EXPANSION = '[A-Fa-f0-9]'
|
10
|
+
NONHEX_EXPANSION = '[^A-Fa-f0-9]'
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def convert_data
|
15
|
+
case subtype
|
16
|
+
when :hex then HEX_EXPANSION
|
17
|
+
when :nonhex then NONHEX_EXPANSION
|
18
|
+
when :any, :digit, :nondigit, :word, :nonword, :space, :nonspace
|
19
|
+
pass_through
|
20
|
+
else
|
21
|
+
warn_of_unsupported_feature
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class JsRegex
|
2
|
+
#
|
3
|
+
module Converter
|
4
|
+
require_relative 'base'
|
5
|
+
#
|
6
|
+
# Template class implementation.
|
7
|
+
#
|
8
|
+
class UnsupportedTokenConverter < JsRegex::Converter::Base
|
9
|
+
private
|
10
|
+
|
11
|
+
def convert_data
|
12
|
+
warn_of_unsupported_feature
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|