aboutsummaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-28 02:05:57 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-28 02:05:57 -0400
commit2ec9f76b7221938061d12e268e97bc33e5653a8e (patch)
tree478a13579034b8bf0a2a533f59ed526b6667573d /pattern.c
parentacdb6ff91b60dab1c65d92f2de35a553ebcb3301 (diff)
Rename 'Match' macro to avoid confusion
Diffstat (limited to 'pattern.c')
-rw-r--r--pattern.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pattern.c b/pattern.c
index 6c3484c..f8f02e3 100644
--- a/pattern.c
+++ b/pattern.c
@@ -15,6 +15,9 @@
#include "utils.h"
#include "utf8.h"
+#define Pattern(_tag, _start, _end, _min, _max, ...) allocate_pat((pat_t){.type=_tag, .start=_start, .end=_end, \
+ .min_matchlen=_min, .max_matchlen=_max, .__tagged._tag={__VA_ARGS__}})
+
static pat_t *allocated_pats = NULL;
__attribute__((nonnull))
@@ -625,7 +628,7 @@ public void delete_pat(pat_t **at_pat, bool recursive)
pat_t *pat = *at_pat;
if (!pat) return;
-#define T(tag, ...) case tag: { auto _data = Match(pat, tag); __VA_ARGS__; break; }
+#define T(tag, ...) case tag: { auto _data = When(pat, tag); __VA_ARGS__; break; }
#define F(field) delete_pat(&_data->field, true)
if (recursive) {
switch (pat->type) {