From e31e13f59ef1a4df1698b15ff1fe0198553cc3c2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 6 Jun 2023 17:50:31 -0300 Subject: First implementation for the accumulator capture --- lpcap.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lpcap.h') diff --git a/lpcap.h b/lpcap.h index 10539a0..e72d913 100644 --- a/lpcap.h +++ b/lpcap.h @@ -16,6 +16,7 @@ typedef enum CapKind { Csimple, /* next node is pattern */ Ctable, /* next node is pattern */ Cfunction, /* ktable[key] is function; next node is pattern */ + Cacc, /* ktable[key] is function; next node is pattern */ Cquery, /* ktable[key] is table; next node is pattern */ Cstring, /* ktable[key] is string; next node is pattern */ Cnum, /* numbered capture; 'key' is number of value to return */ @@ -38,7 +39,8 @@ typedef struct CapState { Capture *cap; /* current capture */ Capture *ocap; /* (original) capture list */ lua_State *L; - int ptop; /* index of last argument to 'match' */ + int ptop; /* stack index of last argument to 'match' */ + int firstcap; /* stack index of first capture pushed in the stack */ const char *s; /* original string */ int valuecached; /* value stored in cache slot */ int reclevel; /* recursion level */ -- cgit v1.2.3-55-g6feb