From 12d173c94b050c244dbb4e2162e29834a9ac3aff Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 3 Aug 2022 16:19:38 +0200 Subject: regex engine - replace many attribute arrays with one This replaces PL_regnode_arg_len, PL_regnode_arg_len_varies, PL_regnode_off_by_arg and PL_regnode_kind with a single PL_regnode_info array, which is an array of struct regnode_meta, which contains the same data but as a struct. Since PL_regnode_name is only used in debugging builds of the regex engine we keep it separate. If we add more debug properties it might be good to create a PL_regnode_debug_info[] to hold that data instead. This means when we add new properties we do not need to modify any secondary sources to add new properites, just the struct definition and regen/regcomp.pl --- regexp.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'regexp.h') diff --git a/regexp.h b/regexp.h index 7bd7162d33..230488f03d 100644 --- a/regexp.h +++ b/regexp.h @@ -22,6 +22,13 @@ typedef SSize_t regnode_offset; +struct regnode_meta { + U8 type; + U8 arg_len; + U8 arg_len_varies; + U8 off_by_arg; +}; + struct regnode { U8 flags; U8 type; -- cgit v1.2.1