parser

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsError

func AsError(err error, target **Error) bool

func IsLimitError

func IsLimitError(err error) bool

func Parse

func Parse(src []byte) (*ast.Document, error)

Types

type DocumentPlan

type DocumentPlan struct {
	Nodes               int
	Definitions         int
	IndexEntries        int
	Values              int
	Arguments           int
	Directives          int
	VariableDefinitions int
}

func Plan

func Plan(src []byte, opts ...Options) (DocumentPlan, error)

type Error

type Error struct {
	Message  string
	Position Position
	Limit    bool
}

func (*Error) Error

func (e *Error) Error() string

type Options

type Options struct {
	MaxDepth              int
	MaxTokens             int
	MaxLiteralSize        int
	MaxDocumentSize       int
	SkipIndexes           bool
	KeepExtensionIdentity bool
	KeepDescriptions      bool
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(opts ...Options) *Parser

func (*Parser) Parse

func (p *Parser) Parse(src []byte) (*ast.Document, error)

func (*Parser) ParseWithArena

func (p *Parser) ParseWithArena(a arena.Arena, src []byte) (*ast.Document, error)

func (*Parser) RecycleArenaDocument

func (p *Parser) RecycleArenaDocument(document *ast.Document)

RecycleArenaDocument releases a successfully parsed arena document back to this parser for reuse. Call it before resetting the document's arena. The caller must not access the document afterwards; resetting the arena remains the caller's responsibility.

type Position

type Position struct {
	Offset int
	Line   int
	Column int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL