eval

package
v0.0.0-...-da2d666 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DictVal

type DictVal struct {
	D map[Value]Value
}

func (*DictVal) MarshalJSON

func (d *DictVal) MarshalJSON() ([]byte, error)

func (*DictVal) UnmarshalJSON

func (d *DictVal) UnmarshalJSON(data []byte) error

type IntVal

type IntVal struct {
	I int
}

func (*IntVal) MarshalJSON

func (i *IntVal) MarshalJSON() ([]byte, error)

func (*IntVal) UnmarshalJSON

func (i *IntVal) UnmarshalJSON(data []byte) error

type NodeVal

type NodeVal struct {
	Src []byte
	N   *sitter.Node
}

func (*NodeVal) Bytes

func (n *NodeVal) Bytes() []byte

func (*NodeVal) Content

func (n *NodeVal) Content() string

func (*NodeVal) MarshalJSON

func (n *NodeVal) MarshalJSON() ([]byte, error)

func (*NodeVal) UnmarshalJSON

func (n *NodeVal) UnmarshalJSON(data []byte) error

type Options

type Options struct {
	Filename string           // optional, can be used to detect language
	Language *sitter.Language // optional, overrides from filename

	Stdout io.Writer // optional, defaults to /dev/null
}

type Program

type Program struct {
	Ast *ast.Program
}

func Compile

func Compile(filename string, src []byte) (*Program, error)

func (*Program) Eval

func (p *Program) Eval(ctx context.Context, src []byte, opts *Options) error

type StringVal

type StringVal struct {
	S string
}

func (*StringVal) MarshalJSON

func (s *StringVal) MarshalJSON() ([]byte, error)

func (*StringVal) UnmarshalJSON

func (s *StringVal) UnmarshalJSON(data []byte) error

type Value

type Value interface {
	json.Marshaler
	json.Unmarshaler
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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