eval

package
v0.0.0-...-9ed520a Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const NaN = "NaN"

Variables

This section is empty.

Functions

func Eval

func Eval(text string, scope map[string]interface{}) (interface{}, error)

Eval evaluates the given expression and returns the result

func Init

func Init()

Types

type CollectingErrorListener

type CollectingErrorListener struct {
	*antlr.DefaultErrorListener
	Error error
}

CollectingErrorListener is an error listener that collects all errors by appending them to the Error field

func (*CollectingErrorListener) SyntaxError

func (l *CollectingErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)

type ExpressionVisitor

type ExpressionVisitor struct {
	parser.BaseSimpleQueryLanguageVisitor
	// contains filtered or unexported fields
}

func (*ExpressionVisitor) Visit

func (v *ExpressionVisitor) Visit(tree antlr.ParseTree) interface{}

func (*ExpressionVisitor) VisitArray

func (v *ExpressionVisitor) VisitArray(context *parser.ArrayContext) interface{}

func (*ExpressionVisitor) VisitExpression

func (v *ExpressionVisitor) VisitExpression(context *parser.ExpressionContext) interface{}

func (*ExpressionVisitor) VisitField

func (v *ExpressionVisitor) VisitField(context *parser.FieldContext) interface{}

func (*ExpressionVisitor) VisitFunction_param

func (v *ExpressionVisitor) VisitFunction_param(ctx *parser.Function_paramContext) interface{}

func (*ExpressionVisitor) VisitIndex

func (v *ExpressionVisitor) VisitIndex(context *parser.IndexContext) interface{}

func (*ExpressionVisitor) VisitName

func (v *ExpressionVisitor) VisitName(context *parser.NameContext) interface{}

func (*ExpressionVisitor) VisitObject

func (v *ExpressionVisitor) VisitObject(context *parser.ObjectContext) interface{}

func (*ExpressionVisitor) VisitObject_field

func (v *ExpressionVisitor) VisitObject_field(context *parser.Object_fieldContext) interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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