treebin

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package treebin contains the implementation-agnostic information about all binary operators that we support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryOpName

func BinaryOpName(op BinaryOperatorSymbol) string

BinaryOpName returns the name of op.

Types

type BinaryOperator

type BinaryOperator struct {
	Symbol BinaryOperatorSymbol
	// IsExplicitOperator is true if OPERATOR(symbol) is used.
	IsExplicitOperator bool
}

BinaryOperator represents a unary operator used in a BinaryExpr.

func MakeBinaryOperator

func MakeBinaryOperator(symbol BinaryOperatorSymbol) BinaryOperator

MakeBinaryOperator creates a BinaryOperator given a symbol.

func (BinaryOperator) Operator

func (BinaryOperator) Operator()

Operator implements tree.Operator.

func (BinaryOperator) String

func (o BinaryOperator) String() string

type BinaryOperatorSymbol

type BinaryOperatorSymbol uint8

BinaryOperatorSymbol is a symbol for a binary operator.

const (
	Bitand BinaryOperatorSymbol = iota
	Bitor
	Bitxor
	Plus
	Minus
	Mult
	Div
	FloorDiv
	Mod
	Pow
	Concat
	LShift
	RShift
	JSONFetchVal
	JSONFetchText
	JSONFetchValPath
	JSONFetchTextPath

	NumBinaryOperatorSymbols
)

BinaryExpr.Operator

func (BinaryOperatorSymbol) IsPadded

func (i BinaryOperatorSymbol) IsPadded() bool

IsPadded returns whether the binary operator needs to be padded.

func (BinaryOperatorSymbol) String

func (i BinaryOperatorSymbol) String() string

Jump to

Keyboard shortcuts

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