summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/lexer.mll7
-rw-r--r--perl_checker.src/test/syntax_restrictions.t2
2 files changed, 7 insertions, 2 deletions
diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll
index f3b56e0..e21dd32 100644
--- a/perl_checker.src/lexer.mll
+++ b/perl_checker.src/lexer.mll
@@ -413,9 +413,13 @@ let set_delimit_char_open lexbuf op =
let char_close =
match char_open with
| '(' -> ')'
- | '{' -> warn lexbuf ("don't use " ^ op ^ "{...}, use " ^ op ^ "(...) instead") ; '}'
+ | '{' -> '}'
| _ -> internal_error "set_delimit_char_open"
in
+ if op = "qx" then
+ warn lexbuf (Printf.sprintf "don't use qx%c...%c, use `...` instead" char_open char_close)
+ else if char_open = '{' then
+ warn lexbuf ("don't use " ^ op ^ "{...}, use " ^ op ^ "(...) instead");
delimit_char_open := char_open;
delimit_char_close := char_close
}
@@ -764,6 +768,7 @@ rule token = parse
COMMAND_STRING(s, pos) }
| "q" pattern_open { set_delimit_char_open lexbuf "q"; raw_ins_to_string qstring lexbuf }
| "qq" pattern_open { set_delimit_char_open lexbuf "qq"; ins_to_string qqstring lexbuf }
+| "qx" pattern_open { set_delimit_char_open lexbuf "qx"; ins_to_string qqstring lexbuf }
| "qw" pattern_open { set_delimit_char_open lexbuf "qw"; let s, pos = raw_ins qstring lexbuf in QUOTEWORDS(s, pos) }
| "\n__END__" [^ '0'-'9' 'A'-'Z' 'a'-'z' '_']
diff --git a/perl_checker.src/test/syntax_restrictions.t b/perl_checker.src/test/syntax_restrictions.t
index c1292f7..6641b7b 100644
--- a/perl_checker.src/test/syntax_restrictions.t
+++ b/perl_checker.src/test/syntax_restrictions.t
@@ -12,7 +12,7 @@ q{xxx} don't use q{...}, use q(...) instead
qq{xxx} don't use qq{...}, use qq(...) instead
-qx(xxx) don't use qx{...}, use `...` instead
+qx(xxx) don't use qx(...), use `...` instead
-xxx don't use -xxx, use '-xxx' instead