summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/perl_checker.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-11-10 16:38:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-11-10 16:38:14 +0000
commitbe344c9ed676859feddde5c24ef78ac78ab5d570 (patch)
tree995c21b37e72e8d2bf8e497578fbe61ece67ff05 /perl_checker.src/perl_checker.ml
parentc8ff668a19bfca65bbcd8f72f939729034c138c2 (diff)
downloadperl_checker-be344c9ed676859feddde5c24ef78ac78ab5d570.tar
perl_checker-be344c9ed676859feddde5c24ef78ac78ab5d570.tar.gz
perl_checker-be344c9ed676859feddde5c24ef78ac78ab5d570.tar.bz2
perl_checker-be344c9ed676859feddde5c24ef78ac78ab5d570.tar.xz
perl_checker-be344c9ed676859feddde5c24ef78ac78ab5d570.zip
*** empty log message ***
Diffstat (limited to 'perl_checker.src/perl_checker.ml')
-rw-r--r--perl_checker.src/perl_checker.ml30
1 files changed, 17 insertions, 13 deletions
diff --git a/perl_checker.src/perl_checker.ml b/perl_checker.src/perl_checker.ml
index cc5bb19..fbb3f4d 100644
--- a/perl_checker.src/perl_checker.ml
+++ b/perl_checker.src/perl_checker.ml
@@ -1,18 +1,22 @@
open Types
let _ =
- let file = try Sys.argv.(2) with _ -> try Sys.argv.(1) with _ -> "/tmp/t.pl" in
- let lexbuf = Lexing.from_channel (open_in file) in
- let _ =
+ let args = List.tl (Array.to_list Sys.argv) in
+ List.iter (fun file ->
try
- Info.start_a_new_file file ;
- if false then
- let t = Lexer.lexbuf2list Lexer.token lexbuf in
- let _,_ = t, t in ""
- else
- Parser.prog Lexer.token lexbuf
- with Failure s -> (
- prerr_endline s ;
- exit 1
+ let lexbuf = Lexing.from_channel (open_in file) in
+ let _ =
+ try
+ Info.start_a_new_file file ;
+ if false then
+ let t = Lexer.lexbuf2list Lexer.token lexbuf in
+ let _,_ = t, t in ""
+ else
+ Parser.prog Lexer.token lexbuf
+ with Failure s -> (
+ prerr_endline s ;
+ exit 1
) in
- ()
+ ()
+ with _ -> prerr_endline ("bad file " ^ file)
+ ) args