func (d *Dispenser) Prev() bool {
	if d.cursor > -1 {
		d.cursor--
		return d.cursor > -1
	}
	return false
}
Prev moves to the previous token. It does the inverse
of Next(), except this function may decrement the cursor
to -1 so that the next call to Next() points to the
first token; this allows dispensing to "start over". This
method returns true if the cursor ends up pointing to a
valid token.
package caddyfile
import (
	"errors"
	"fmt"
	"io"
	"log"
	"strings"
)
type Dispenser struct {
	tokens  []Token
	cursor  int
	nesting int
}
func NewDispenser(tokens []Token) *Dispenser {
	return &Dispenser{
		tokens: tokens,
		cursor: -1,
	}
}
func NewTestDispenser(input string) *Dispenser {
	tokens, err := allTokens("Testfile", []byte(input))
	if err != nil && err != io.EOF {
		log.Fatalf("getting all tokens from input: %v", err)
	}
	return NewDispenser(tokens)
}
func (d *Dispenser) Next() bool {
	if d.cursor < len(d.tokens)-1 {
		d.cursor++
		return true
	}
	return false
}