Documentation
¶
Overview ¶
Copyright 2020 Pavel Knoblokh. All rights reserved. Use of this source code is governed by MIT License that can be found in the LICENSE file. nolint: govet
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
View Source
var ( Parser = participle.MustBuild( &Expression{}, participle.Lexer(myLexer), participle.Unquote("String"), participle.CaseInsensitive("LogicOp", "Boolean"), ) )
Functions ¶
func EvalParsed ¶
func EvalParsed(expr *Expression, obj Gettable) (interface{}, error)
Types ¶
type Compare ¶
type ConditionOperand ¶
func (*ConditionOperand) Eval ¶
func (c *ConditionOperand) Eval(ctx *Context) (interface{}, error)
type Expression ¶
type Expression struct {
Pos lexer.Position
Or []*OrCondition `@@ { "OR" @@ }`
}
func Parse ¶
func Parse(expr string) (*Expression, error)
func (*Expression) Eval ¶
func (e *Expression) Eval(ctx *Context) (interface{}, error)
type OrCondition ¶
type OrCondition struct {
Pos lexer.Position
And []*ConditionOperand `@@ { "AND" @@ }`
}
func (*OrCondition) Eval ¶
func (o *OrCondition) Eval(ctx *Context) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.