context

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

func New

func New() *Context

func (*Context) AddError

func (c *Context) AddError(err error)

func (*Context) BindVariable

func (c *Context) BindVariable(name string, typ VarType, offset int)

func (*Context) CurrentScope

func (c *Context) CurrentScope() *Scope

func (*Context) EnterScope

func (c *Context) EnterScope()

func (*Context) Errors

func (c *Context) Errors() []error

func (*Context) ExitScope

func (c *Context) ExitScope()

func (*Context) GetState

func (c *Context) GetState() ParseState

func (*Context) HasErrors

func (c *Context) HasErrors() bool

func (*Context) InClauseState

func (c *Context) InClauseState() bool

func (*Context) IsVariableDeclared

func (c *Context) IsVariableDeclared(name string) bool

func (*Context) LookupVariable

func (c *Context) LookupVariable(name string) *VarBinding

func (*Context) MarkVariableUsed

func (c *Context) MarkVariableUsed(name string)

func (*Context) SetState

func (c *Context) SetState(state ParseState)

type ParseState

type ParseState int
const (
	StateInitial ParseState = iota
	StateInMatch
	StateInCreate
	StateInMerge
	StateInWhere
	StateInReturn
	StateInWith
	StateInSet
	StateInDelete
	StateInRemove
	StateInPattern
	StateInExpression
	StateInListComprehension
	StateInPatternComprehension
)

func (ParseState) String

func (s ParseState) String() string

type Scope

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

func NewScope

func NewScope(parent *Scope) *Scope

func (*Scope) Bind

func (s *Scope) Bind(name string, typ VarType, offset int) *VarBinding

func (*Scope) IsBound

func (s *Scope) IsBound(name string) bool

func (*Scope) Lookup

func (s *Scope) Lookup(name string) *VarBinding

func (*Scope) MarkUsed

func (s *Scope) MarkUsed(name string)

type VarBinding

type VarBinding struct {
	Name     string
	Type     VarType
	Declared bool
	Used     bool
	Offset   int
}

type VarType

type VarType int
const (
	VarUnknown VarType = iota
	VarNode
	VarRelationship
	VarPath
	VarMap
	VarList
	VarScalar
)

func (VarType) String

func (v VarType) String() string

Jump to

Keyboard shortcuts

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