mirror of
https://github.com/lua/lua
synced 2024-11-22 12:51:30 +03:00
4cd1f4aac0
Start of the implementation of "scoped variables" or "to be closed" variables, local variables whose '__close' (or themselves) are called when they go out of scope. This commit implements the syntax, the opcode, and the creation of the corresponding upvalue, but it still does not call the finalizations when the variable goes out of scope (the most important part). Currently, the syntax is 'local scoped name = exp', but that will probably change.
96 lines
1.0 KiB
C
96 lines
1.0 KiB
C
/*
|
|
** $Id: lopnames.h $
|
|
** Opcode names
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
|
|
#if !defined(lopnames_h)
|
|
#define lopnames_h
|
|
|
|
/* ORDER OP */
|
|
|
|
static const char *const opnames[] = {
|
|
"MOVE",
|
|
"LOADI",
|
|
"LOADF",
|
|
"LOADK",
|
|
"LOADKX",
|
|
"LOADBOOL",
|
|
"LOADNIL",
|
|
"GETUPVAL",
|
|
"SETUPVAL",
|
|
"GETTABUP",
|
|
"GETTABLE",
|
|
"GETI",
|
|
"GETFIELD",
|
|
"SETTABUP",
|
|
"SETTABLE",
|
|
"SETI",
|
|
"SETFIELD",
|
|
"NEWTABLE",
|
|
"SELF",
|
|
"ADDI",
|
|
"SUBI",
|
|
"MULI",
|
|
"MODI",
|
|
"POWI",
|
|
"DIVI",
|
|
"IDIVI",
|
|
"BANDK",
|
|
"BORK",
|
|
"BXORK",
|
|
"SHRI",
|
|
"SHLI",
|
|
"ADD",
|
|
"SUB",
|
|
"MUL",
|
|
"MOD",
|
|
"POW",
|
|
"DIV",
|
|
"IDIV",
|
|
"BAND",
|
|
"BOR",
|
|
"BXOR",
|
|
"SHL",
|
|
"SHR",
|
|
"UNM",
|
|
"BNOT",
|
|
"NOT",
|
|
"LEN",
|
|
"CONCAT",
|
|
"CLOSE",
|
|
"TBC",
|
|
"JMP",
|
|
"EQ",
|
|
"LT",
|
|
"LE",
|
|
"EQK",
|
|
"EQI",
|
|
"LTI",
|
|
"LEI",
|
|
"GTI",
|
|
"GEI",
|
|
"TEST",
|
|
"TESTSET",
|
|
"CALL",
|
|
"TAILCALL",
|
|
"RETURN",
|
|
"RETURN0",
|
|
"RETURN1",
|
|
"FORLOOP1",
|
|
"FORPREP1",
|
|
"FORLOOP",
|
|
"FORPREP",
|
|
"TFORCALL",
|
|
"TFORLOOP",
|
|
"SETLIST",
|
|
"CLOSURE",
|
|
"VARARG",
|
|
"PREPVARARG",
|
|
"EXTRAARG",
|
|
NULL
|
|
};
|
|
|
|
#endif
|
|
|