operator

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 0 Imported by: 0 modules, 0 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

View Source
var Binary = map[string]Operator{
	"|":          {0, Left},
	"or":         {10, Left},
	"||":         {10, Left},
	"and":        {15, Left},
	"&&":         {15, Left},
	"==":         {20, Left},
	"!=":         {20, Left},
	"<":          {20, Left},
	">":          {20, Left},
	">=":         {20, Left},
	"<=":         {20, Left},
	"in":         {20, Left},
	"matches":    {20, Left},
	"contains":   {20, Left},
	"startsWith": {20, Left},
	"endsWith":   {20, Left},
	"..":         {25, Left},
	"+":          {30, Left},
	"-":          {30, Left},
	"*":          {60, Left},
	"/":          {60, Left},
	"%":          {60, Left},
	"**":         {100, Right},
	"^":          {100, Right},
	"??":         {500, Left},
}
View Source
var Unary = map[string]Operator{
	"not": {50, Left},
	"!":   {50, Left},
	"-":   {90, Left},
	"+":   {90, Left},
}

Functions

func Less

func Less(a, b string) bool

Types

type Associativity

type Associativity int
const (
	Left Associativity = iota + 1
	Right
)

type Operator

type Operator struct {
	Precedence    int
	Associativity Associativity
}

Jump to

Keyboard shortcuts

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