summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-04-02 11:26:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-04-02 11:26:29 +0000
commit9f85d1a79fc1c8bd1542194d4730a3ff2e90e991 (patch)
treed80c1a591d5b6e774355d7c9b310a2959c816c8c
parent68850ba7153887d3b69eaaa574990b0e54851179 (diff)
downloadperl_checker-9f85d1a79fc1c8bd1542194d4730a3ff2e90e991.tar
perl_checker-9f85d1a79fc1c8bd1542194d4730a3ff2e90e991.tar.gz
perl_checker-9f85d1a79fc1c8bd1542194d4730a3ff2e90e991.tar.bz2
perl_checker-9f85d1a79fc1c8bd1542194d4730a3ff2e90e991.tar.xz
perl_checker-9f85d1a79fc1c8bd1542194d4730a3ff2e90e991.zip
enhance warning "... =~ /^foo$/" is better written "... eq 'foo'"
-rw-r--r--perl_checker.src/parser_helper.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 21f91d8..d5869ec 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -428,7 +428,7 @@ let check_simple_pattern = function
st.[0] = '^' && st.[String.length st - 1] = '$' then
let st = skip_n_char_ 1 1 st in
if string_forall_with char_is_alphanumerical_ 0 st then
- warn_rule (sprintf "\"... =~ /^%s$/\" is better written \"... eq %s\"" st st)
+ warn_rule (sprintf "\"... =~ /^%s$/\" is better written \"... eq '%s'\"" st st)
| _ -> ()
let rec only_one (l, (spaces, pos)) =