class JsRegex::Converter::ConditionalConverter
Template class implementation.
Private Instance Methods
convert_data()
click to toggle source
# File lib/js_regex/converter/conditional_converter.rb, line 11 def convert_data case subtype when :open then mark_conditional else warn_of_unsupported_feature end end
mark_conditional()
click to toggle source
# File lib/js_regex/converter/conditional_converter.rb, line 18 def mark_conditional reference = expression.referenced_expression.number node = Node.new('(?:', reference: reference, type: :conditional) expression.branches.each do |branch| node << Node.new('(?:', convert_expression(branch), ')') end node << ')' end