expr

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: BSD-3-Clause Imports: 9 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToSameType added in v0.5.5

func ConvertToSameType(left interface{}, right interface{}) (interface{}, interface{}, error)

Types

type Expr

type Expr interface {
	EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)
	Eval() (interface{}, error)
	EvalWithData(value interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)
}

type Expression

type Expression struct {
	Left     *Expression `json:"left"`
	Operator OPERATIOR   `json:"operator"`
	Right    *Expression `json:"right"`

	Value interface{}       `json:"value"`
	Type  funcexprtype.Type `json:"type"`
}

func NewExpression

func NewExpression() *Expression

func (*Expression) Eval

func (f *Expression) Eval() (interface{}, error)

func (*Expression) EvalWithData

func (f *Expression) EvalWithData(data interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*Expression) EvalWithScope

func (f *Expression) EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*Expression) IsFunction

func (e *Expression) IsFunction() bool

func (*Expression) IsNil

func (e *Expression) IsNil() bool

func (*Expression) String

func (e *Expression) String() string

func (*Expression) UnmarshalJSON

func (e *Expression) UnmarshalJSON(exprData []byte) error

type OPERATIOR

type OPERATIOR int
const (
	EQ OPERATIOR = iota
	OR
	AND
	NOT_EQ
	GT
	LT
	GTE
	LTE
	ADDITION
	SUBTRACTION
	MULTIPLICATION
	DIVISION
	INT_DIVISTION
	MODULAR_DIVISION
	GEGATIVE
	UNINE
)

func ToOperator

func ToOperator(operator string) (OPERATIOR, bool)

func (OPERATIOR) String

func (o OPERATIOR) String() string

type TernaryExpressio

type TernaryExpressio struct {
	First  interface{}
	Second interface{}
	Third  interface{}
}

func (*TernaryExpressio) Eval

func (t *TernaryExpressio) Eval() (interface{}, error)

func (*TernaryExpressio) EvalWithData

func (t *TernaryExpressio) EvalWithData(value interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*TernaryExpressio) EvalWithScope

func (t *TernaryExpressio) EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*TernaryExpressio) HandleParameter

func (t *TernaryExpressio) HandleParameter(param interface{}, value interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

Jump to

Keyboard shortcuts

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