From b52b60054e9d08ab7cdc20620c18bc2c45e71a2c Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Mon, 16 Jun 2014 20:23:36 +0200 Subject: Checking that a library name is valid before compilation. Fixes bug #3333. --- tools/coqc.ml | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'tools') diff --git a/tools/coqc.ml b/tools/coqc.ml index 0a9ea4e89f..90585c763b 100644 --- a/tools/coqc.ml +++ b/tools/coqc.ml @@ -23,30 +23,6 @@ let image = ref "" let verbose = ref false -(* Verifies that a string starts by a letter and do not contain - others caracters than letters, digits, or `_` *) - -let check_module_name s = - let err c = - output_string stderr "Invalid module name: "; - output_string stderr s; - output_string stderr " character "; - if c = '\'' then - output_string stderr "\"'\"" - else - (output_string stderr"'"; output_char stderr c; output_string stderr"'"); - output_string stderr " is not allowed in module names\n"; - exit 1 - in - match String.get s 0 with - | 'a' .. 'z' | 'A' .. 'Z' -> - for i = 1 to (String.length s)-1 do - match String.get s i with - | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' -> () - | c -> err c - done - | c -> err c - let rec make_compilation_args = function | [] -> [] | file :: fl -> @@ -55,7 +31,6 @@ let rec make_compilation_args = function Filename.chop_suffix file ".v" else file in - check_module_name (Filename.basename file_noext); (if !verbose then "-compile-verbose" else "-compile") :: file_noext :: (make_compilation_args fl) -- cgit v1.2.3