package
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Feb 18, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Op represents a Lua binary or unary operator. It also encode its precedence.
const (
OpLt Op = 2 + iota<<8
OpLeq
OpGt
OpGeq
OpEq
OpNeq
)
Precedence 2 binary operators
const (
OpShiftL Op = 6 + iota<<8
OpShiftR
)
Precedence 6 binary operators (bitwise shifts)
const (
OpAdd Op = 8 + iota<<8
OpSub
)
Precendence 8 binary operators (add / subtract)
const (
OpMul Op = 9 + iota<<8
OpDiv
OpFloorDiv
OpMod
)
Precedence 9 binary operators (multiplication / division / modulo)
const (
OpNeg Op = 10 + iota<<8
OpNot
OpLen
OpBitNot
OpId
)
Unary operators have precedence 10
OpAnd is a logical and (precedence 1)
const OpBitAnd Op = 5 + iota<<8
OpBitAnd is bitwise and (precedence 5)
const OpBitOr Op = 3 + iota<<8
OpBitOr is bitwise or (precedence 3)
const OpBitXor Op = 4 + iota<<8
OpBitXor is bitwise exclusive or (precedence 4)
const OpConcat Op = 7 + iota<<8
OpConcat is the concatenate operator (precedence 7)
OpOr is a logical or (precedence 0)
OpPow (power) is special, precendence 10.
func (op Op) Precedence() int
Precedence returns the precedence of an operator (higher means binds more
tightly).
Type returns the type of operator (which coincides with the precedence atm).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.