} STMT_END
# endif
-# define DEBUG_f(a) if (DEBUG_f_TEST) a
-# define DEBUG_r(a) if (DEBUG_r_TEST) a
-# define DEBUG_x(a) if (DEBUG_x_TEST) a
-# define DEBUG_u(a) if (DEBUG_u_TEST) a
-# define DEBUG_L(a) if (DEBUG_L_TEST) a
-# define DEBUG_H(a) if (DEBUG_H_TEST) a
-# define DEBUG_X(a) if (DEBUG_X_TEST) a
-# define DEBUG_D(a) if (DEBUG_D_TEST) a
+# define DEBUG__(t, a) \
+ STMT_START { \
+ if (t) STMT_START {a;} STMT_END; \
+ } STMT_END
+
+# define DEBUG_f(a) DEBUG__(DEBUG_f_TEST, a)
+# define DEBUG_r(a) DEBUG__(DEBUG_r_TEST, a)
+# define DEBUG_x(a) DEBUG__(DEBUG_x_TEST, a)
+# define DEBUG_u(a) DEBUG__(DEBUG_u_TEST, a)
+# define DEBUG_L(a) DEBUG__(DEBUG_L_TEST, a)
+# define DEBUG_H(a) DEBUG__(DEBUG_H_TEST, a)
+# define DEBUG_X(a) DEBUG__(DEBUG_X_TEST, a)
+# define DEBUG_D(a) DEBUG__(DEBUG_D_TEST, a)
# ifdef USE_THREADS
-# define DEBUG_S(a) if (DEBUG_S_TEST) a
+# define DEBUG_S(a) DEBUG__(DEBUG_S_TEST, a)
# else
# define DEBUG_S(a)
# endif
-# define DEBUG_T(a) if (DEBUG_T_TEST) a
-# define DEBUG_R(a) if (DEBUG_R_TEST) a
+# define DEBUG_T(a) DEBUG__(DEBUG_T_TEST, a)
+# define DEBUG_R(a) DEBUG__(DEBUG_R_TEST, a)
#else /* DEBUGGING */
SV* rv;
if (SvROK(sv) && SvOBJECT(rv = SvRV(sv))) {
- DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning object ref:\n "), sv_dump(sv));)
+ DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning object ref:\n "), sv_dump(sv)));
if (SvWEAKREF(sv)) {
sv_del_backref(sv);
SvWEAKREF_off(sv);
(GvIO(sv) && SvOBJECT(GvIO(sv))) ||
(GvCV(sv) && SvOBJECT(GvCV(sv))) )
{
- DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning named glob object:\n "), sv_dump(sv));)
+ DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning named glob object:\n "), sv_dump(sv)));
SvREFCNT_dec(sv);
}
}
static void
do_clean_all(pTHXo_ SV *sv)
{
- DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at 0x%"UVxf"\n", PTR2UV(sv)) );)
+ DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at 0x%"UVxf"\n", PTR2UV(sv)) ));
SvFLAGS(sv) |= SVf_BREAK;
SvREFCNT_dec(sv);
}
sv_catpv(report, PL_tokenbuf);
}
PerlIO_printf(Perl_debug_log, "### %s\n", SvPV_nolen(report));
- })
+ });
}
/*
PL_pending_ident = 0;
DEBUG_T({ PerlIO_printf(Perl_debug_log,
- "### Tokener saw identifier '%s'\n", PL_tokenbuf); })
+ "### Tokener saw identifier '%s'\n", PL_tokenbuf); });
/* if we're in a my(), we can't allow dynamics here.
$foo'bar has already been turned into $foo::bar, so
}
DEBUG_T({ PerlIO_printf(Perl_debug_log,
"### Next token after '%s' was known, type %"IVdf"\n", PL_bufptr,
- (IV)PL_nexttype[PL_nexttoke]); })
+ (IV)PL_nexttype[PL_nexttoke]); });
return(PL_nexttype[PL_nexttoke]);
}
else {
DEBUG_T({ PerlIO_printf(Perl_debug_log,
- "### Saw case modifier at '%s'\n", PL_bufptr); })
+ "### Saw case modifier at '%s'\n", PL_bufptr); });
s = PL_bufptr + 1;
if (strnEQ(s, "L\\u", 3) || strnEQ(s, "U\\l", 3))
tmp = *s, *s = s[2], s[2] = tmp; /* misordered... */
if (PL_bufptr == PL_bufend)
return sublex_done();
DEBUG_T({ PerlIO_printf(Perl_debug_log,
- "### Interpolated variable at '%s'\n", PL_bufptr); })
+ "### Interpolated variable at '%s'\n", PL_bufptr); });
PL_expect = XTERM;
PL_lex_dojoin = (*PL_bufptr == '@');
PL_lex_state = LEX_INTERPNORMAL;
DEBUG_T( {
PerlIO_printf(Perl_debug_log, "### Tokener expecting %s at %s\n",
exp_name[PL_expect], s);
- } )
+ } );
retry:
switch (*s) {
yyerror("Missing right curly or square bracket");
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Tokener got EOF\n");
- } )
+ } );
TOKEN(0);
}
if (s++ < PL_bufend)
s = force_word(PL_bufptr,WORD,FALSE,FALSE,FALSE);
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw unary minus before =>, forcing word '%s'\n", s);
- } )
+ } );
OPERATOR('-'); /* unary minus */
}
PL_last_uni = PL_oldbufptr;
PL_last_lop_op = ftst;
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw file test %c\n", (int)ftst);
- } )
+ } );
FTST(ftst);
}
else {
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### %c looked like a file test but was not\n",
(int)ftst);
- } )
+ } );
s -= 2;
}
}
s = scan_num(s, &yylval);
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw number in '%s'\n", s);
- } )
+ } );
if (PL_expect == XOPERATOR)
no_op("Number",s);
TERM(THING);
s = scan_str(s,FALSE,FALSE);
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw string before '%s'\n", s);
- } )
+ } );
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
PL_expect = XTERM;
s = scan_str(s,FALSE,FALSE);
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw string before '%s'\n", s);
- } )
+ } );
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
PL_expect = XTERM;
s = scan_str(s,FALSE,FALSE);
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw backtick string before '%s'\n", s);
- } )
+ } );
if (PL_expect == XOPERATOR)
no_op("Backticks",s);
if (!s)