module Asciidoctor::Helpers

def nextval current

returns the next value in the sequence according to the current value's type

current - the value to increment as a String or Integer

Handles both integer and character sequences.

Internal: Get the next value in the sequence.
def nextval current
  if ::Integer === current
    current + 1
  elsif (intval = current.to_i).to_s == current.to_s
    intval + 1
  else
    current.succ
  end
end