summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2022-11-27 15:27:50 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2022-12-08 12:59:50 +0000
commitcd7d784879026948126140d82b84bb39bb779c2e (patch)
tree2401c913fa64207ddecaf38e2f95d5c36a5fbf2b /proto.h
parentfe31205d63da5c2b38cf8ffbdf08f3a18430a0da (diff)
downloadperl-cd7d784879026948126140d82b84bb39bb779c2e.tar.gz
Define a PL_infix_plugin hook, of a similar style to PL_keyword_plugin
Runs for identifier-named custom infix operators and sequences of non-identifier symbol characters. Defines multiple precedence levels for custom infix operators that fit alongside exponentiation, multiplication, addition, or relational comparision operators, as well as a "high" and "low" at either end.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 80446bcd0f..df65610c6c 100644
--- a/proto.h
+++ b/proto.h
@@ -430,6 +430,11 @@ PERL_CALLCONV void Perl_boot_core_mro(pTHX)
__attribute__visibility__("hidden");
#define PERL_ARGS_ASSERT_BOOT_CORE_MRO
+PERL_CALLCONV OP * Perl_build_infix_plugin(pTHX_ OP *lhs, OP *rhs, void *tokendata)
+ __attribute__visibility__("hidden");
+#define PERL_ARGS_ASSERT_BUILD_INFIX_PLUGIN \
+ assert(lhs); assert(rhs); assert(tokendata)
+
PERL_CALLCONV int Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen, const U8 *u, STRLEN ulen);
#define PERL_ARGS_ASSERT_BYTES_CMP_UTF8 \
assert(b); assert(u)
@@ -1777,6 +1782,9 @@ PERL_CALLCONV void Perl_hv_undef_flags(pTHX_ HV *hv, U32 flags);
/* PERL_CALLCONV I32 ibcmp_utf8(pTHX_ const char *s1, char **pe1, UV l1, bool u1, const char *s2, char **pe2, UV l2, bool u2); */
#define PERL_ARGS_ASSERT_IBCMP_UTF8
+PERL_CALLCONV STRLEN Perl_infix_plugin_standard(pTHX_ char* operator_ptr, STRLEN operator_len, struct Perl_custom_infix** def);
+#define PERL_ARGS_ASSERT_INFIX_PLUGIN_STANDARD \
+ assert(operator_ptr); assert(def)
PERL_CALLCONV void Perl_init_argv_symbols(pTHX_ int argc, char **argv)
__attribute__visibility__("hidden");
#define PERL_ARGS_ASSERT_INIT_ARGV_SYMBOLS \
@@ -4642,6 +4650,9 @@ PERL_CALLCONV I32 Perl_whichsig_pvn(pTHX_ const char* sig, STRLEN len);
PERL_CALLCONV I32 Perl_whichsig_sv(pTHX_ SV* sigsv);
#define PERL_ARGS_ASSERT_WHICHSIG_SV \
assert(sigsv)
+PERL_CALLCONV void Perl_wrap_infix_plugin(pTHX_ Perl_infix_plugin_t new_plugin, Perl_infix_plugin_t *old_plugin_p);
+#define PERL_ARGS_ASSERT_WRAP_INFIX_PLUGIN \
+ assert(new_plugin); assert(old_plugin_p)
PERL_CALLCONV void Perl_wrap_keyword_plugin(pTHX_ Perl_keyword_plugin_t new_plugin, Perl_keyword_plugin_t *old_plugin_p);
#define PERL_ARGS_ASSERT_WRAP_KEYWORD_PLUGIN \
assert(new_plugin); assert(old_plugin_p)