diff options
author | Yves Orton <demerphq@gmail.com> | 2022-08-03 16:19:38 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-08-06 11:32:34 +0200 |
commit | 12d173c94b050c244dbb4e2162e29834a9ac3aff (patch) | |
tree | 7da7cb9fd9869b779d4b8f8ffaf5fa4402a75bc1 /regexp.h | |
parent | cbf5c5ba5f44cf0fe11b64213facfc8ae7c33e4e (diff) | |
download | perl-12d173c94b050c244dbb4e2162e29834a9ac3aff.tar.gz |
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
Diffstat (limited to 'regexp.h')
-rw-r--r-- | regexp.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |