func lexerEntrypoint(l *Lexer) stateFn {
Loop:
	for {
		switch r := l.next(); {
		case r == EOFRUNE:
			break Loop
		case r == '{':
			l.emit(TokenTypeLeftBrace)
		case r == '}':
			l.emit(TokenTypeRightBrace)
		case r == '(':
			l.emit(TokenTypeLeftParen)
		case r == ')':
			l.emit(TokenTypeRightParen)
		case r == '+':
			l.emit(TokenTypePlus)
		case r == '|':
			l.emit(TokenTypePipe)
		case r == '&':
			l.emit(TokenTypeAnd)
		case r == '=':
			l.emit(TokenTypeEquals)
		case r == ':':
			l.emit(TokenTypeColon)
		case r == ';':
			l.emit(TokenTypeSemicolon)
		case r == '#':
			l.emit(TokenTypeHash)
		case r == '.':
			if l.acceptString("..") {
				l.emit(TokenTypeEllipsis)
			} else {
				return l.errorf("unrecognized character at this location: %#U", r)
			}
		case r == '-':
			if l.accept(">") {
				l.emit(TokenTypeRightArrow)
			} else {
				l.emit(TokenTypeMinus)
			}
		case isSpace(r):
			l.emit(TokenTypeWhitespace)
		case isNewline(r):
			if _, ok := syntheticPredecessors[l.lastNonIgnoredToken.Kind]; ok {
				l.emit(TokenTypeSyntheticSemicolon)
			} else {
				l.emit(TokenTypeNewline)
			}
		case isAlphaNumeric(r):
			l.backup()
			return lexIdentifierOrKeyword
		case r == '/':
			if l.peekValue("/") {
				l.backup()
				return lexSinglelineComment
			}
			if l.peekValue("*") {
				l.backup()
				return lexMultilineComment
			}
			l.emit(TokenTypeDiv)
		default:
			return l.errorf("unrecognized character at this location: %#U", r)
		}
	}
	l.emit(TokenTypeEOF)
	return nil
}
lexerEntrypoint scans until EOFRUNE
package lexer
import (
	"unicode"
	"github.com/authzed/spicedb/pkg/schemadsl/input"
)
func Lex(source input.InputSource, input string) *Lexer {
	return createLexer(source, input)
}
type TokenType int
const (
	TokenTypeError TokenType = iota  
	TokenTypeSyntheticSemicolon
	TokenTypeEOF
	TokenTypeWhitespace
	TokenTypeSinglelineComment
	TokenTypeMultilineComment
	TokenTypeNewline
	TokenTypeKeyword     
	TokenTypeIdentifier  
	TokenTypeNumber      
	TokenTypeLeftBrace   
	TokenTypeRightBrace  
	TokenTypeLeftParen   
	TokenTypeRightParen  
	TokenTypePipe   
	TokenTypePlus   
	TokenTypeMinus  
	TokenTypeAnd    
	TokenTypeDiv    
	TokenTypeEquals      
	TokenTypeColon       
	TokenTypeSemicolon   
	TokenTypeRightArrow  
	TokenTypeHash        
	TokenTypeEllipsis    
)
var keywords = map[string]bool{
	"definition": true,
	"relation":   true,
	"permission": true,
}
var syntheticPredecessors = map[TokenType]bool{
	TokenTypeIdentifier: true,
	TokenTypeKeyword:    true,
	TokenTypeRightBrace: true,
	TokenTypeRightParen: true,
}