aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/lua-lpeg/lpcap.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/lua-lpeg/lpcap.h')
-rw-r--r--contrib/lua-lpeg/lpcap.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/contrib/lua-lpeg/lpcap.h b/contrib/lua-lpeg/lpcap.h
index d762fdcfa..dc10d6969 100644
--- a/contrib/lua-lpeg/lpcap.h
+++ b/contrib/lua-lpeg/lpcap.h
@@ -1,5 +1,5 @@
/*
-** $Id: lpcap.h,v 1.2 2015/02/27 17:13:17 roberto Exp $
+** $Id: lpcap.h $
*/
#if !defined(lpcap_h)
@@ -11,8 +11,21 @@
/* kinds of captures */
typedef enum CapKind {
- Cclose, Cposition, Cconst, Cbackref, Carg, Csimple, Ctable, Cfunction,
- Cquery, Cstring, Cnum, Csubst, Cfold, Cruntime, Cgroup
+ Cclose, /* not used in trees */
+ Cposition,
+ Cconst, /* ktable[key] is Lua constant */
+ Cbackref, /* ktable[key] is "name" of group to get capture */
+ Carg, /* 'key' is arg's number */
+ Csimple, /* next node is pattern */
+ Ctable, /* next node is pattern */
+ Cfunction, /* 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 */
+ Csubst, /* substitution capture; next node is pattern */
+ Cfold, /* ktable[key] is function; next node is pattern */
+ Cruntime, /* not used in trees (is uses another type for tree) */
+ Cgroup /* ktable[key] is group's "name" */
} CapKind;
@@ -31,6 +44,7 @@ typedef struct CapState {
int ptop; /* index of last argument to 'match' */
const char *s; /* original string */
int valuecached; /* value stored in cache slot */
+ int reclevel; /* recursion level */
} CapState;