1
0
mirror of https://github.com/janet-lang/janet synced 2025-12-12 19:48:07 +00:00

Add lenprefix combinator to pegs.

This lets peg match n repeitions of a pattern, where
n is supplied from other parsed input and is not a constant.
This commit is contained in:
Calvin Rose
2020-05-02 10:37:39 -05:00
parent 761ea65d81
commit 8b5bcaee3c
4 changed files with 68 additions and 0 deletions

View File

@@ -1576,6 +1576,7 @@ typedef enum {
RULE_ERROR, /* [rule] */
RULE_DROP, /* [rule] */
RULE_BACKMATCH, /* [tag] */
RULE_LENPREFIX, /* [rule_a, rule_b (repeat rule_b rule_a times)] */
} JanetPegOpcode;
typedef struct {