class Temple::Mixins::GrammarDSL::Element

def after_copy(source)

def after_copy(source)
  @children = @children.map do |child|
    child == source ? self : child.copy_to(@grammar)
  end
  @rule = @rule.copy_to(@grammar)
end

def initialize(grammar, rule)

def initialize(grammar, rule)
  super(grammar)
  @rule = grammar.Rule(rule)
end

def match(exp, unmatched)

def match(exp, unmatched)
  return false unless Array === exp && !exp.empty?
  head, *tail = exp
  @rule.match(head, unmatched) && super(tail, unmatched)
end