=for apidoc Ams||LEAVE
Closing bracket on a callback. See C<ENTER> and L<perlcall>.
+=over
+
+=item ENTER_with_name(name)
+
+Same as C<ENTER>, but when debugging is enabled it also associates the
+given literal string with the new scope.
+
+=item LEAVE_with_name(name)
+
+Same as C<LEAVE>, but when debugging is enabled it first checks that the
+scope has the given name. Name must be a literal string.
+
+=back
+
=cut
*/
DEBUG_SCOPE("LEAVE") \
pop_scope(); \
} STMT_END
+#define ENTER_with_name(name) \
+ STMT_START { \
+ push_scope(); \
+ if (PL_scopestack_name) \
+ PL_scopestack_name[PL_scopestack_ix-1] = name; \
+ DEBUG_SCOPE("ENTER \"" name "\"") \
+ } STMT_END
+#define LEAVE_with_name(name) \
+ STMT_START { \
+ DEBUG_SCOPE("LEAVE \"" name "\"") \
+ if (PL_scopestack_name) { \
+ assert(((char*)PL_scopestack_name[PL_scopestack_ix-1] \
+ == (char*)name) \
+ || strEQ(PL_scopestack_name[PL_scopestack_ix-1], name)); \
+ } \
+ pop_scope(); \
+ } STMT_END
#else
#define ENTER push_scope()
#define LEAVE pop_scope()
+#define ENTER_with_name(name) ENTER
+#define LEAVE_with_name(name) LEAVE
#endif
#define LEAVE_SCOPE(old) if (PL_savestack_ix > old) leave_scope(old)