diff --git a/src/lib_protocol_compiler/packer.ml b/src/lib_protocol_compiler/packer.ml index 5e62e05d0cf434f11f4a105649f9adac7249205b..ae90110b447dbb39d0b01f2de3f76bd794d2eb09 100644 --- a/src/lib_protocol_compiler/packer.ml +++ b/src/lib_protocol_compiler/packer.ml @@ -78,6 +78,19 @@ let include_ml oc file = let unit = String.capitalize_ascii (Filename.chop_extension (Filename.basename file)) in + let () = + String.iter + (function + | 'A' .. 'Z' | 'a' .. 'z' | '0' .. '9' | '_' -> + () + | other -> + Format.kasprintf + Stdlib.failwith + "protocol-compiler: module %S uses an illegal character: %c." + unit + other) + unit + in Printf.fprintf oc "module %s " unit ; let mli = file ^ "i" in if Sys.file_exists mli then (