-let set_baseuri st name =
- let baseuri = Filename.concat st.output_base_uri name in
- set_items st name [T.BaseUri baseuri]
-
-let require st name =
- set_items st name [T.Include st.package]
-
+let require st name moo inc =
+ set_items st name [T.Include (moo, inc)]
+
+let get_coercion st str =
+ try List.assoc str st.coercions with Not_found -> ""
+
+let make_path path =
+ List.fold_left Filename.concat "" (List.rev path)
+
+let make_prefix path =
+ String.concat "__" (List.rev path) ^ "__"
+
+let make_script_name st script name =
+ let ext = if script.is_ma then ".ma" else ".mma" in
+ Filename.concat st.output_path (name ^ ext)
+
+let get_iparams st name =
+ let debug debug = GA.IPDebug debug in
+ let map = function
+ | "comments" -> GA.IPComments
+ | "nodefaults" -> GA.IPNoDefaults
+ | "coercions" -> GA.IPCoercions
+ | "cr" -> GA.IPCR
+ | s ->
+ try Scanf.sscanf s "debug-%u" debug with
+ | Scanf.Scan_failure _
+ | Failure _
+ | End_of_file ->
+ failwith ("unknown inline parameter: " ^ s)
+ in
+ List.map map (X.list_assoc_all name st.iparams)
+