aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/include
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2024-09-12 17:03:03 -0500
committerCalvin Rose <calsrose@gmail.com>2024-09-12 17:23:34 -0500
commit9694aee819af65f0089e351c450343d5d11b41ad (patch)
treec2fd5ea77dcdc62338465bbfcb305e8c181ed562 /src/include
parentMore CI testing. (diff)
Add rules for nth and only-tags. Address #1503
These rules allow selecting from a number of sub-captures while dropping the rest. `nth` is more succinct in many cases, but `only-tags` is more general and corresponds to an internal mechanism already present.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/janet.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/janet.h b/src/include/janet.h
index ce37b84a..eb0b462f 100644
--- a/src/include/janet.h
+++ b/src/include/janet.h
@@ -2180,7 +2180,9 @@ typedef enum {
RULE_UNREF, /* [rule, tag] */
RULE_CAPTURE_NUM, /* [rule, tag] */
RULE_SUB, /* [rule, rule] */
- RULE_SPLIT /* [rule, rule] */
+ RULE_SPLIT, /* [rule, rule] */
+ RULE_NTH, /* [nth, rule, tag] */
+ RULE_ONLY_TAGS, /* [rule] */
} JanetPegOpcod;
typedef struct {