ast

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat

func Concat(items ...interface{}) ([]interface{}, error)

func Key

func Key(indexer interface{}) (interface{}, error)

Types

type Expr

type Expr interface {
	Init(resolver resolve.CompositeResolver, root bool) error //todo can use root to multi-thread eval of root node

	Eval(scope data.Scope) (interface{}, error)
}

func AppendToExprList

func AppendToExprList(list, x interface{}) ([]Expr, error)

func NewArithExpr

func NewArithExpr(left, operand, right interface{}) (Expr, error)

func NewBoolExpr

func NewBoolExpr(left, operand, right interface{}) (Expr, error)

func NewCmpExpr

func NewCmpExpr(left, operand, right interface{}) (Expr, error)

func NewExprList

func NewExprList(x interface{}) ([]Expr, error)

func NewFuncExpr

func NewFuncExpr(name interface{}, args interface{}) (Expr, error)

func NewLiteral

func NewLiteral(litType string, lit interface{}) (Expr, error)

func NewRefExpr

func NewRefExpr(refNode ...interface{}) (Expr, error)

func NewTernaryArgument

func NewTernaryArgument(first interface{}) (Expr, error)

func NewTernaryExpr

func NewTernaryExpr(ifNode, thenNode, elseNode interface{}) (Expr, error)

func NewUnaryExpr

func NewUnaryExpr(operand, tok interface{}) (Expr, error)

type GetValueExpr

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

func (*GetValueExpr) Eval

func (d *GetValueExpr) Eval(scope data.Scope) (interface{}, error)

func (*GetValueExpr) Init

func (d *GetValueExpr) Init(resolver resolve.CompositeResolver, root bool) error

type IsDefinedExpr

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

func (*IsDefinedExpr) Eval

func (d *IsDefinedExpr) Eval(scope data.Scope) (interface{}, error)

func (*IsDefinedExpr) Init

func (d *IsDefinedExpr) Init(resolver resolve.CompositeResolver, root bool) error

Jump to

Keyboard shortcuts

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