func (l *Lexer) value() string {
	return l.input[l.start:l.pos]
}
value returns the current value of the token in the lexer.
package lexer
import (
	"fmt"
	"strings"
	"unicode/utf8"
	"github.com/authzed/spicedb/pkg/schemadsl/input"
)
const EOFRUNE = -1
func createLexer(source input.InputSource, input string) *Lexer {
	l := &Lexer{
		source: source,
		input:  input,
		tokens: make(chan Lexeme),
		closed: make(chan struct{}),
	}
	go l.run()
	return l
}
func (l *Lexer) run() {
	for l.state = lexSource; l.state != nil; {
		l.state = l.state(l)
	}
	close(l.tokens)
}
func (l *Lexer) Close() {
	l.state = nil
	close(l.closed)
}
type Lexeme struct {
	Kind     TokenType           
	Position input.BytePosition  
	Value    string              
}
type stateFn func(*Lexer) stateFn
type Lexer struct {
	source                 input.InputSource   
	input                  string              
	state                  stateFn             
	pos                    input.BytePosition  
	start                  input.BytePosition  
	width                  input.BytePosition  
	lastPos                input.BytePosition  
	tokens                 chan Lexeme         
	currentToken           Lexeme              
	lastNonWhitespaceToken Lexeme              
	lastNonIgnoredToken    Lexeme              
	closed                 chan struct{}       
}
func (l *Lexer) nextToken() Lexeme {
	token := <-l.tokens
	l.lastPos = token.Position
	return token
}
func (l *Lexer) next() rune {
	if int(l.pos) >= len(l.input) {
		l.width = 0
		return EOFRUNE
	}
	r, w := utf8.DecodeRuneInString(l.input[l.pos:])
	l.width = input.BytePosition(w)
	l.pos += l.width
	return r
}
func (l *Lexer) peek() rune {
	r := l.next()
	l.backup()
	return r
}
func (l *Lexer) backup() {
	l.pos -= l.width
}