|
@@ -288,10 +288,13 @@ let handle_display_argument com file_pos pre_compilation did_something =
|
|
|
pmax = pos;
|
|
|
}
|
|
|
|
|
|
+let file_input_marker = Path.unique_full_path "? input"
|
|
|
+
|
|
|
type display_path_kind =
|
|
|
| DPKNormal of path
|
|
|
| DPKMacro of path
|
|
|
| DPKDirect of string
|
|
|
+ | DPKInput of string
|
|
|
| DPKNone
|
|
|
|
|
|
let process_display_file com classes =
|
|
@@ -318,6 +321,16 @@ let process_display_file com classes =
|
|
|
match com.display.dms_display_file_policy with
|
|
|
| DFPNo ->
|
|
|
DPKNone
|
|
|
+ | DFPOnly when (DisplayPosition.display_position#get).pfile = file_input_marker ->
|
|
|
+ classes := [];
|
|
|
+ com.main_class <- None;
|
|
|
+ begin match !TypeloadParse.current_stdin with
|
|
|
+ | Some input ->
|
|
|
+ TypeloadParse.current_stdin := None;
|
|
|
+ DPKInput input
|
|
|
+ | None ->
|
|
|
+ DPKNone
|
|
|
+ end
|
|
|
| dfp ->
|
|
|
if dfp = DFPOnly then begin
|
|
|
classes := [];
|
|
@@ -369,6 +382,14 @@ let load_display_file_standalone ctx file =
|
|
|
end;
|
|
|
ignore(TypeloadModule.type_module ctx (pack,name) file ~dont_check_path:true decls null_pos)
|
|
|
|
|
|
+let load_display_content_standalone ctx input =
|
|
|
+ let com = ctx.com in
|
|
|
+ let file = file_input_marker in
|
|
|
+ let p = {pfile = file; pmin = 0; pmax = 0} in
|
|
|
+ let parsed = TypeloadParse.parse_file_from_string com file p input in
|
|
|
+ let pack,decls = TypeloadParse.handle_parser_result com file p parsed in
|
|
|
+ ignore(TypeloadModule.type_module ctx (pack,"?DISPLAY") file ~dont_check_path:true decls p)
|
|
|
+
|
|
|
let promote_type_hints tctx =
|
|
|
let rec explore_type_hint (md,p,t) =
|
|
|
match t with
|