From 5603f27d0c70bf36f089b5830eae87c6486f07bc Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 24 May 1999 03:03:05 +0000 Subject: [PATCH] minor logic tweak for reserved word warning p4raw-id: //depot/perl@3451 --- lib/Test/Harness.pm | 2 +- toke.c | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) 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); + } } } -- 2.7.4