pub enum ExprKind {
Show 22 variants
Void,
Nil,
True,
False,
K,
KFlt,
KInt,
KStr,
NonReloc,
Local,
UpVal,
Const,
Indexed,
IndexUp,
IndexI,
IndexStr,
VarArgVar,
VarArgIndex,
Jmp,
Reloc,
Call,
VarArg,
}Expand description
The descriptor kind of a parsed expression: where its value currently lives
and how to materialize it. Drives every discharge/exp2* decision in
codegen. The associated data each kind carries lives in ExprPayload.
Variants§
Void
Empty expression (an empty list slot).
Nil
Constant nil.
True
Constant true.
False
Constant false.
K
Constant already in the function’s constant table; carries its index.
KFlt
Float literal.
KInt
Integer literal.
KStr
String literal (interned).
NonReloc
Value sitting in a fixed register that must not be relocated.
Local
Local variable; carries its register and stack-frame variable indices.
UpVal
Upvalue; carries its upvalue index.
Const
Compile-time constant; carries its absolute active-variable index.
Indexed
Table indexed by a register key; carries table register and key index.
IndexUp
Upvalue indexed by a constant key.
IndexI
Table indexed by an integer key.
IndexStr
Table indexed by a short-string key.
VarArgVar
Named vararg parameter; carries its register and variable indices.
VarArgIndex
Indexed named vararg parameter.
Jmp
Test/comparison whose value is realized by a jump; carries the jump pc.
Reloc
Result that may land in any register; carries the instruction pc.
Call
Function call; carries the call instruction’s pc.
VarArg
Vararg expansion; carries the instruction pc.