class ConcatOperator

The standard RegexOperator, provides concatination

Public Class Methods

new() click to toggle source
# File lib/ruby_grammar_builder/regex_operators/concat.rb, line 9
def initialize
    @precedence = 2
    @association = :left
end

Public Instance Methods

do_evaluate_self(arr_left, arr_right) click to toggle source

(see RegexOperator#do_evaluate_self)

# File lib/ruby_grammar_builder/regex_operators/concat.rb, line 15
def do_evaluate_self(arr_left, arr_right)
    left = fold_left(arr_left)
    right = fold_right(arr_right)

    self_string = left[0]+right[0]

    [left[1], self_string, right[1]].flatten
end