From: Gurusamy Sarathy Date: Mon, 24 May 1999 03:03:05 +0000 (+0000) Subject: minor logic tweak for reserved word warning X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5603f27d0c70bf36f089b5830eae87c6486f07bc;p=p5sagit%2Fp5-mst-13.2.git minor logic tweak for reserved word warning p4raw-id: //depot/perl@3451 --- diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index 662ec7f..3cc3749 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -300,7 +300,7 @@ sub runtests { die "Failed $bad/$total test scripts, $pct% okay.$subpct\n"; } } - printf("Files=%d, Tests=%d, %s\n", $files, $totmax, timestr($t_total, 'nop')); + printf("Files=%d, Tests=%d, %s\n", $files, $totmax, timestr($t_total, 'nop')); return ($bad == 0 && $totmax) ; } diff --git a/toke.c b/toke.c index 441839b..0105fe1 100644 --- a/toke.c +++ b/toke.c @@ -3255,17 +3255,19 @@ int yylex(PERL_YYLEX_PARAM_DECL) TOKEN(NOAMP); } - if (PL_hints & HINT_STRICT_SUBS) - yylval.opval->op_private |= OPpCONST_STRICT; - /* Call it a bare word */ - bareword: - if (ckWARN(WARN_RESERVED)) { - if (lastchar != '-') { - for (d = PL_tokenbuf; *d && isLOWER(*d); d++) ; - if (!*d) - warner(WARN_RESERVED, PL_warn_reserved, PL_tokenbuf); + if (PL_hints & HINT_STRICT_SUBS) + yylval.opval->op_private |= OPpCONST_STRICT; + else { + bareword: + if (ckWARN(WARN_RESERVED)) { + if (lastchar != '-') { + for (d = PL_tokenbuf; *d && isLOWER(*d); d++) ; + if (!*d) + warner(WARN_RESERVED, PL_warn_reserved, + PL_tokenbuf); + } } }