func lexSinglelineComment(l *Lexer) stateFn {
	checker := func(r rune) (bool, error) {
		result := r == EOFRUNE || isNewline(r)
		return !result, nil
	}
	l.acceptString("//")
	return buildLexUntil(TokenTypeSinglelineComment, checker)
}
lexSinglelineComment scans until newline or 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,
}
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
}