Initialization of separate units; fixed runtime

This commit is contained in:
Dmitry Boulytchev 2020-01-26 06:06:14 +03:00
parent 811c24d5a6
commit c09a3b36b6
13 changed files with 116 additions and 46 deletions

View file

@ -104,7 +104,11 @@ class options args =
| Some name -> name
method get_help = !help
method get_include_paths = !paths
method basename = Filename.chop_suffix self#get_infile ".expr"
method basename = Filename.chop_suffix (Filename.basename self#get_infile) ".expr"
method topname =
match !mode with
| `Compile -> "init" ^ self#basename
| _ -> "main"
method dump_file ext contents =
let name = self#basename in
let outf = open_out (Printf.sprintf "%s.%s" name ext) in