summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-01-13 20:37:01 +0100
committerYves Orton <demerphq@gmail.com>2023-01-14 17:53:20 +0100
commitcc8af69427466b91a81167e24e583e8638b32949 (patch)
tree5cc80e779f92c8c93a16a25f804c3564ef51b775 /embed.fnc
parent33019846eaa4ea3ee24c40e9765272bbc0f49317 (diff)
downloadperl-cc8af69427466b91a81167e24e583e8638b32949.tar.gz
embed.pl - add a way to declare a parameter should be non-zero
This autogenerates the required asserts to validate a parameter is non-zero. It uses it to replace the check in regrepeat() as a first example.
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc5
1 files changed, 4 insertions, 1 deletions
diff --git a/embed.fnc b/embed.fnc
index a45372ec7d..04ce678669 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -600,6 +600,9 @@
: know "I have defined whether NULL is OK or not" rather than having neither
: NULL or NULLOK, which is ambiguous.
:
+: Numeric arguments may also be prefixed with NZ, which will cause the
+: appropriate asserts to be generated to validate that this is the case.
+:
: Flags should be sorted asciibetically.
:
: Please keep the next line *BLANK*
@@ -5321,7 +5324,7 @@ WERS |I32 |regrepeat |NN regexp *prog \
|NN const regnode *p \
|NN char *loceol \
|NN regmatch_info * const reginfo \
- |I32 max
+ |NZ I32 max
ERS |bool |regtry |NN regmatch_info *reginfo \
|NN char **startposp
ERS |bool |reginclass |NULLOK regexp * const prog \