package operators
import "github.com/google/cel-go/common/operators"
Package operators defines the internal function names of operators.
ALl operators in the expression language are modelled as function calls.
Index ¶
- Constants
- func Find(text string) (string, bool)
- func FindReverse(op string) (string, bool)
- func FindReverseBinaryOperator(op string) (string, bool)
- func Precedence(op string) int
Constants ¶
const ( // Symbolic operators. Conditional = "_?_:_" LogicalAnd = "_&&_" LogicalOr = "_||_" LogicalNot = "!_" Equals = "_==_" NotEquals = "_!=_" Less = "_<_" LessEquals = "_<=_" Greater = "_>_" GreaterEquals = "_>=_" Add = "_+_" Subtract = "_-_" Multiply = "_*_" Divide = "_/_" Modulo = "_%_" Negate = "-_" Index = "_[_]" // Macros, must have a valid identifier. Has = "has" All = "all" Exists = "exists" ExistsOne = "exists_one" Map = "map" Filter = "filter" // Named operators, must not have be valid identifiers. NotStrictlyFalse = "@not_strictly_false" In = "@in" // Deprecated: named operators with valid identifiers. OldNotStrictlyFalse = "__not_strictly_false__" OldIn = "_in_" )
String "names" for CEL operators.
Functions ¶
func Find ¶
Find the internal function name for an operator, if the input text is one.
func FindReverse ¶
FindReverse returns the unmangled, text representation of the operator.
func FindReverseBinaryOperator ¶
FindReverseBinaryOperator returns the unmangled, text representation of a binary operator.
func Precedence ¶
Precedence returns the operator precedence, where the higher the number indicates higher precedence operations.
Source Files ¶
- Version
- v0.4.0-beta.1
- Published
- Feb 5, 2020
- Platform
- js/wasm
- Last checked
- 2 seconds ago –
Tools for package owners.