From: Rafael Garcia-Suarez Date: Tue, 17 Oct 2006 07:44:09 +0000 (+0000) Subject: Less brace nesting. X-Git-Tag: perl-5.9.5~1934 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/d9f2850e1dace825c523d7e9c58701cfcfa11e3c Less brace nesting. p4raw-id: //depot/perl@29028 --- diff --git a/toke.c b/toke.c index 4ab58ea..f9e79fc 100644 --- a/toke.c +++ b/toke.c @@ -5397,7 +5397,8 @@ Perl_yylex(pTHX) #ifdef PERL_MAD cv && #endif - SvPOK(cv)) { + SvPOK(cv)) + { STRLEN protolen; const char *proto = SvPV_const((SV*)cv, protolen); if (!protolen) @@ -6566,6 +6567,9 @@ Perl_yylex(pTHX) /* Look for a prototype */ if (*s == '(') { + char *p; + bool bad_proto = FALSE; + const bool warnsyntax = ckWARN(WARN_SYNTAX); s = scan_str(s,!!PL_madskills,FALSE); if (!s) @@ -6573,23 +6577,18 @@ Perl_yylex(pTHX) /* strip spaces and check for bad characters */ d = SvPVX(PL_lex_stuff); tmp = 0; - { - char *p; - bool bad_proto = FALSE; - const bool warnsyntax = ckWARN(WARN_SYNTAX); - for (p = d; *p; ++p) { - if (!isSPACE(*p)) { - d[tmp++] = *p; - if (warnsyntax && !strchr("$@%*;[]&\\", *p)) - bad_proto = TRUE; - } + for (p = d; *p; ++p) { + if (!isSPACE(*p)) { + d[tmp++] = *p; + if (warnsyntax && !strchr("$@%*;[]&\\", *p)) + bad_proto = TRUE; } - d[tmp] = '\0'; - if (bad_proto) - Perl_warner(aTHX_ packWARN(WARN_SYNTAX), - "Illegal character in prototype for %"SVf" : %s", - (void*)PL_subname, d); } + d[tmp] = '\0'; + if (bad_proto) + Perl_warner(aTHX_ packWARN(WARN_SYNTAX), + "Illegal character in prototype for %"SVf" : %s", + (void*)PL_subname, d); SvCUR_set(PL_lex_stuff, tmp); have_proto = TRUE;