diff options
author | chai <chaifix@163.com> | 2021-11-08 01:17:11 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-08 01:17:11 +0800 |
commit | efce5b6bd5c9d4f8214a71e0f7a7c35751710a4c (patch) | |
tree | 0789475ded5c377667165a3ddb047ca6703bcf33 /ThirdParty/lpeg-1.0.2/lpcode.h | |
parent | ed78df90944bbe6b7de7308bda2bf3a7f1bc3de6 (diff) |
+ tolua
+ lpeg
Diffstat (limited to 'ThirdParty/lpeg-1.0.2/lpcode.h')
-rw-r--r-- | ThirdParty/lpeg-1.0.2/lpcode.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ThirdParty/lpeg-1.0.2/lpcode.h b/ThirdParty/lpeg-1.0.2/lpcode.h new file mode 100644 index 0000000..34ee276 --- /dev/null +++ b/ThirdParty/lpeg-1.0.2/lpcode.h @@ -0,0 +1,40 @@ +/* +** $Id: lpcode.h $ +*/ + +#if !defined(lpcode_h) +#define lpcode_h + +#include "lua.h" + +#include "lptypes.h" +#include "lptree.h" +#include "lpvm.h" + +int tocharset (TTree *tree, Charset *cs); +int checkaux (TTree *tree, int pred); +int fixedlen (TTree *tree); +int hascaptures (TTree *tree); +int lp_gc (lua_State *L); +Instruction *compile (lua_State *L, Pattern *p); +void realloccode (lua_State *L, Pattern *p, int nsize); +int sizei (const Instruction *i); + + +#define PEnullable 0 +#define PEnofail 1 + +/* +** nofail(t) implies that 't' cannot fail with any input +*/ +#define nofail(t) checkaux(t, PEnofail) + +/* +** (not nullable(t)) implies 't' cannot match without consuming +** something +*/ +#define nullable(t) checkaux(t, PEnullable) + + + +#endif |