# File lib/facets/more/stateparser.rb, line 253
  def next_end( index )
    token = @stack.last.token
    match = @stack.last.match
    re = machine.send( "#{token}_#{ENDMATCH}", match, self ) #machine.tokens[token].stop(match,self)
    i = text.index( re, offset )
    m = $~ if i
    e = m.end(0) if i
    if i and i < index # what comes first?
      @mode = :END
      @current[:token] = token
      @current[:begins] = i
      @current[:ends] = e
      @current[:match] = m
      #@current[:info] = f
      return i
    end
    return index
  end