class RDoc::Markdown::Literals

def apply_with_args(rule, *args)

def apply_with_args(rule, *args)
  memo_key = [rule, args]
  if m = @memoizations[memo_key][@pos]
    @pos = m.pos
    if !m.set
      m.left_rec = true
      return nil
    end
    @result = m.result
    return m.ans
  else
    m = MemoEntry.new(nil, @pos)
    @memoizations[memo_key][@pos] = m
    start_pos = @pos
    ans = __send__ rule, *args
    lr = m.left_rec
    m.move! ans, @pos, @result
    # Don't bother trying to grow the left recursion
    # if it's failing straight away (thus there is no seed)
    if ans and lr
      return grow_lr(rule, args, start_pos, m)
    else
      return ans
    end
    return ans
  end
end