ops

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Op

type Op uint
const (
	OpLt Op = 2 + iota<<8
	OpLeq
	OpGt
	OpGeq
	OpEq
	OpNeq
)
const (
	OpShiftL Op = 6 + iota<<8
	OpShiftR
)
const (
	OpAdd Op = 8 + iota<<8
	OpSub
)
const (
	OpMul Op = 9 + iota<<8
	OpDiv
	OpFloorDiv
	OpMod
)
const (
	OpNeg Op = 10 + iota<<8
	OpNot
	OpLen
	OpBitNot
	OpID
)
const OpAnd Op = 1 + iota<<8
const OpBitAnd Op = 5 + iota<<8
const OpBitOr Op = 3 + iota<<8
const OpBitXor Op = 4 + iota<<8
const OpConcat Op = 7 + iota<<8
const OpOr Op = iota << 8
const OpPow Op = 11 + iota<<8
const OpToNumber Op = 0x10000

OpToNumber is used in e.g. for loops

func (Op) Precedence

func (op Op) Precedence() int

Precedence returns the precedence of an operator (higher means binds more tightly).

func (Op) String

func (op Op) String() string

Jump to

Keyboard shortcuts

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