From 2ec9f76b7221938061d12e268e97bc33e5653a8e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 28 May 2024 02:05:57 -0400 Subject: Rename 'Match' macro to avoid confusion --- pattern.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pattern.c') 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) { -- cgit v1.2.3