aboutsummaryrefslogtreecommitdiff
path: root/lpvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'lpvm.h')
-rw-r--r--lpvm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lpvm.h b/lpvm.h
index 576429f..9fde967 100644
--- a/lpvm.h
+++ b/lpvm.h
@@ -17,6 +17,7 @@ typedef enum Opcode {
17 ITestChar, /* if char != aux, jump to 'offset' */ 17 ITestChar, /* if char != aux, jump to 'offset' */
18 ITestSet, /* if char not in buff, jump to 'offset' */ 18 ITestSet, /* if char not in buff, jump to 'offset' */
19 ISpan, /* read a span of chars in buff */ 19 ISpan, /* read a span of chars in buff */
20 IUTFR, /* if codepoint not in range [offset, utf_to], fail */
20 IBehind, /* walk back 'aux' characters (fail if not possible) */ 21 IBehind, /* walk back 'aux' characters (fail if not possible) */
21 IRet, /* return from a rule */ 22 IRet, /* return from a rule */
22 IEnd, /* end of pattern */ 23 IEnd, /* end of pattern */
@@ -50,6 +51,10 @@ typedef union Instruction {
50} Instruction; 51} Instruction;
51 52
52 53
54/* extract 24-bit value from an instruction */
55#define utf_to(inst) (((inst)->i.key << 8) | (inst)->i.aux)
56
57
53void printpatt (Instruction *p, int n); 58void printpatt (Instruction *p, int n);
54const char *match (lua_State *L, const char *o, const char *s, const char *e, 59const char *match (lua_State *L, const char *o, const char *s, const char *e,
55 Instruction *op, Capture *capture, int ptop); 60 Instruction *op, Capture *capture, int ptop);