Class: JsRegex::Converter::TypeConverter
- Defined in:
- lib/js_regex/converter/type_converter.rb
Overview
Template class implementation.
Constant Summary collapse
- HEX_EXPANSION =
'[0-9A-Fa-f]'- NONHEX_EXPANSION =
'[^0-9A-Fa-f]'- ES2018_HEX_EXPANSION =
'\p{AHex}'- ES2018_NONHEX_EXPANSION =
'\P{AHex}'- ES2018_XGRAPHEME_EXPANSION =
'[\P{M}\P{Lm}](?:(?:[\u035C\u0361]\P{M}\p{M}*)|\u200d|\p{M}|\p{Lm}|\p{Emoji_Modifier})*'- LINEBREAK_EXPANSION =
'(?:\r\n|[\n\v\f\r\u0085\u2028\u2029])'
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.directly_compatible?(expression, _context = nil) ⇒ Boolean
16 17 18 19 20 21 22 23 |
# File 'lib/js_regex/converter/type_converter.rb', line 16 def self.directly_compatible?(expression, _context = nil) case expression.token when :space, :nonspace !expression.ascii_classes? when :digit, :nondigit, :word, :nonword !expression.unicode_classes? end end |