Module: JsRegex::Converter
- Defined in:
- lib/js_regex/converter.rb,
lib/js_regex/converter/base.rb,
lib/js_regex/converter/context.rb,
lib/js_regex/converter/set_converter.rb,
lib/js_regex/converter/keep_converter.rb,
lib/js_regex/converter/meta_converter.rb,
lib/js_regex/converter/type_converter.rb,
lib/js_regex/converter/group_converter.rb,
lib/js_regex/converter/anchor_converter.rb,
lib/js_regex/converter/escape_converter.rb,
lib/js_regex/converter/literal_converter.rb,
lib/js_regex/converter/property_converter.rb,
lib/js_regex/converter/assertion_converter.rb,
lib/js_regex/converter/freespace_converter.rb,
lib/js_regex/converter/conditional_converter.rb,
lib/js_regex/converter/backreference_converter.rb,
lib/js_regex/converter/subexpression_converter.rb,
lib/js_regex/converter/unsupported_token_converter.rb
Defined Under Namespace
Classes: AnchorConverter, AssertionConverter, BackreferenceConverter, Base, ConditionalConverter, Context, EscapeConverter, FreespaceConverter, GroupConverter, KeepConverter, LiteralConverter, MetaConverter, PropertyConverter, SetConverter, SubexpressionConverter, TypeConverter, UnsupportedTokenConverter
Constant Summary collapse
- MAP =
Hash.new(UnsupportedTokenConverter).merge( anchor: AnchorConverter, assertion: AssertionConverter, backref: BackreferenceConverter, conditional: ConditionalConverter, escape: EscapeConverter, expression: SubexpressionConverter, free_space: FreespaceConverter, group: GroupConverter, keep: KeepConverter, literal: LiteralConverter, meta: MetaConverter, nonproperty: PropertyConverter, property: PropertyConverter, set: SetConverter, type: TypeConverter ).freeze
Class Method Summary collapse
- .convert(exp, context = nil) ⇒ Object
- .for(expression) ⇒ Object
-
.surrogate_pair_limit=(_arg) ⇒ Object
Legacy method.
Class Method Details
.convert(exp, context = nil) ⇒ Object
26 27 28 |
# File 'lib/js_regex/converter.rb', line 26 def convert(exp, context = nil) self.for(exp).convert(exp, context || Context.new) end |
.for(expression) ⇒ Object
30 31 32 |
# File 'lib/js_regex/converter.rb', line 30 def for(expression) MAP[expression.type].new end |
.surrogate_pair_limit=(_arg) ⇒ Object
Legacy method. Remove in v4.0.0.
35 36 37 |
# File 'lib/js_regex/converter.rb', line 35 def surrogate_pair_limit=(_arg) warn '#surrogate_pair_limit= is deprecated and has no effect anymore.' end |