summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-11-15 20:57:59 -0700
committerKarl Williamson <khw@cpan.org>2021-01-20 06:51:49 -0700
commite513125ac7bdea1f40ab055ab8c72da44de8f869 (patch)
tree7f5b5bbf26fabd9f8c3af261ed83c85da92885eb /embed.fnc
parenta7b8d88a7db0f93e2ec0bef63f0460d0d3247b10 (diff)
downloadperl-e513125ac7bdea1f40ab055ab8c72da44de8f869.tar.gz
Revamp regcurly(), regpiece() use of it
This commit copies portions of new_regcurly(), which has been around since 5.28, into plain regcurly(), as a baby step in preparation for converting entirely to the new one. These functions are used for parsing {m,n} quantifiers. Future commits will add capabilities not available using the old version. The commit adds an optional parameter, to return to the caller information it gleans during parsing. regpiece() is changed by this commit to use this information, instead of itself reparsing the input. Part of the reason for this commit is that changes are planned soon to what is legal syntax. With this commit in place, those changes only have to be done once. This commit also extracts into a function the calculation of the quantifier bounds. This allows the logic for that to be done in one place instead of two.
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc4
1 files changed, 3 insertions, 1 deletions
diff --git a/embed.fnc b/embed.fnc
index e633097f9b..5ff0a9bebe 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2082,6 +2082,8 @@ ES |void |dump_regex_sets_structures \
# endif
ES |void|parse_lparen_question_flags|NN RExC_state_t *pRExC_state
ES |regnode_offset|reg_node|NN RExC_state_t *pRExC_state|U8 op
+ES |U32 |get_quantifier_value|NN RExC_state_t *pRExC_state \
+ |NN const char * start|NN const char * end
ES |regnode_offset|regpiece|NN RExC_state_t *pRExC_state \
|NN I32 *flagp|U32 depth
ES |bool |grok_bslash_N |NN RExC_state_t *pRExC_state \
@@ -2343,7 +2345,7 @@ EXTp |UV |_to_fold_latin1|const U8 c|NN U8 *p|NN STRLEN *lenp|const unsigned int
EpX |SV* |invlist_clone |NN SV* const invlist|NULLOK SV* newlist
#endif
#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C)
-EXpRT |bool |regcurly |NN const char *s
+EXpRT |bool |regcurly |NN const char *s|NN const char *e|NULLOK const char * result[5]
#endif
#if defined(PERL_IN_REGEXEC_C)
ERS |bool |isFOO_utf8_lc |const U8 classnum|NN const U8* character|NN const U8* e