class RDoc::Markdown::Literals

def apply(rule)

def apply(rule)
  if m = @memoizations[rule][@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[rule][@pos] = m
    start_pos = @pos
    ans = __send__ rule
    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, nil, start_pos, m)
    else
      return ans
    end
    return ans
  end
end