aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/include/janet.h
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2021-02-26 17:25:09 -0600
committerCalvin Rose <calsrose@gmail.com>2021-02-26 17:25:09 -0600
commit96513665d6538c5fee287ea71596e7d5332008c3 (patch)
tree4f5cda431bc4c424eeed25a3e870d958f2b92427 /src/include/janet.h
parentDon't fail testing when ev disabled. (diff)
Address #641 - add undef combinator.
The (undef rule :tag) combinator lets a user "scope" tagged captures. After the rule has matched, all captures with tag :tag can no longer be refered to by their tag. However, such captures from outside rule are kept as is. If no tag is given, all tagged captures from rule are unreferenced. Note that this doesn't `drop` the captures, merely removes their association with the tag. This means subsequent calls to `backref` and `backmatch` will no longer "see" these tagged captures.
Diffstat (limited to 'src/include/janet.h')
-rw-r--r--src/include/janet.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/janet.h b/src/include/janet.h
index 59d6a37c..a8efc545 100644
--- a/src/include/janet.h
+++ b/src/include/janet.h
@@ -1841,7 +1841,8 @@ typedef enum {
RULE_LENPREFIX, /* [rule_a, rule_b (repeat rule_b rule_a times)] */
RULE_READINT, /* [(signedness << 4) | (endianess << 5) | bytewidth, tag] */
RULE_LINE, /* [tag] */
- RULE_COLUMN /* [tag] */
+ RULE_COLUMN, /* [tag] */
+ RULE_UNREF /* [rule, tag] */
} JanetPegOpcod;
typedef struct {