mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-29 16:52:28 +00:00
Add Lua compiler
Redbean Lua Server Pages may now be stored in the zip as byte code. This can improve performance, since redbean currently doesn't cache byte code but it might be more useful for anyone wanting to create a closed source redbean. The .lua extension should be used for byte code files. Lua will tell them apart based on a magic number at the start of the file. This change also improves some Lua error reporting conditions. See #97
This commit is contained in:
parent
b703eee96e
commit
3bfb7580c5
16 changed files with 864 additions and 91 deletions
35
third_party/lua/ltm.h
vendored
35
third_party/lua/ltm.h
vendored
|
@ -9,43 +9,10 @@
|
|||
|
||||
#include "third_party/lua/lobject.h"
|
||||
#include "third_party/lua/luaconf.h"
|
||||
#include "third_party/lua/tms.h"
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/*
|
||||
* WARNING: if you change the order of this enumeration,
|
||||
* grep "ORDER TM" and "ORDER OP"
|
||||
*/
|
||||
typedef enum {
|
||||
TM_INDEX,
|
||||
TM_NEWINDEX,
|
||||
TM_GC,
|
||||
TM_MODE,
|
||||
TM_LEN,
|
||||
TM_EQ, /* last tag method with fast access */
|
||||
TM_ADD,
|
||||
TM_SUB,
|
||||
TM_MUL,
|
||||
TM_MOD,
|
||||
TM_POW,
|
||||
TM_DIV,
|
||||
TM_IDIV,
|
||||
TM_BAND,
|
||||
TM_BOR,
|
||||
TM_BXOR,
|
||||
TM_SHL,
|
||||
TM_SHR,
|
||||
TM_UNM,
|
||||
TM_BNOT,
|
||||
TM_LT,
|
||||
TM_LE,
|
||||
TM_CONCAT,
|
||||
TM_CALL,
|
||||
TM_CLOSE,
|
||||
TM_N /* number of elements in the enum */
|
||||
} TMS;
|
||||
|
||||
|
||||
/*
|
||||
** Mask with 1 in all fast-access methods. A 1 in any of these bits
|
||||
** in the flag of a (meta)table means the metatable does not have the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue