func (p *sourceParser) createErrorNode(format string, args ...interface{}) AstNode {
	message := fmt.Sprintf(format, args...)
	node := p.startNode(dslshape.NodeTypeError).Decorate(dslshape.NodePredicateErrorMessage, message)
	p.finishNode()
	return node
}
createErrorNode creates a new error node and returns it.
package parser
import (
	"fmt"
	"github.com/authzed/spicedb/pkg/schemadsl/dslshape"
	"github.com/authzed/spicedb/pkg/schemadsl/input"
	"github.com/authzed/spicedb/pkg/schemadsl/lexer"
)
type AstNode interface {
	Connect(predicate string, other AstNode) AstNode
	Decorate(property string, value string) AstNode
	DecorateWithInt(property string, value int) AstNode
}
type NodeBuilder func(source input.InputSource, kind dslshape.NodeType) AstNode
type tryParserFn func() (AstNode, bool)
type lookaheadParserFn func(currentToken lexer.Lexeme) bool
type rightNodeConstructor func(AstNode, lexer.Lexeme) (AstNode, bool)
type commentedLexeme struct {
	lexer.Lexeme
	comments []string
}
type sourceParser struct {
	source        input.InputSource     
	lex           *lexer.PeekableLexer  
	builder       NodeBuilder           
	nodes         *nodeStack            
	currentToken  commentedLexeme       
	previousToken commentedLexeme       
}
func buildParser(lx *lexer.Lexer, builder NodeBuilder, source input.InputSource, input string) *sourceParser {
	l := lexer.NewPeekableLexer(lx)
	return &sourceParser{
		source:        source,
		lex:           l,
		builder:       builder,
		nodes:         &nodeStack{},
		currentToken:  commentedLexeme{lexer.Lexeme{Kind: lexer.TokenTypeEOF}, make([]string, 0)},
		previousToken: commentedLexeme{lexer.Lexeme{Kind: lexer.TokenTypeEOF}, make([]string, 0)},
	}
}
func (p *sourceParser) close() {
	p.lex.Close()
}
func (p *sourceParser) createNode(kind dslshape.NodeType) AstNode {
	return p.builder(p.source, kind)
}