@@ -230,7 +230,7 @@ module Setup = struct
230
230
let setup_common_context ctx =
231
231
let com = ctx.com in
232
232
ctx.com.print < - ctx.comm.write_out;
233
- Common. define_value com Define. HaxeVer (Printf. sprintf " %.3f" (float_of_int Globals. version /. 1000. ));
233
+ Common. define_value com Define. HaxeVer (Printf. sprintf " %.3f" (float_of_int version /. 1000. ));
234
234
Common. raw_define com " haxe3" ;
235
235
Common. raw_define com " haxe4" ;
236
236
Common. raw_define com " haxe5" ;
@@ -419,6 +419,10 @@ let compile ctx actx callbacks =
419
419
) (List. rev actx.cmds)
420
420
end
421
421
422
+ let make_ice_message com msg backtrace =
423
+ let ver = (s_version_full com.version) in
424
+ let os_type = if Sys. unix then " unix" else " windows" in
425
+ Printf. sprintf " %s\n Haxe: %s; OS type: %s;\n %s" msg ver os_type backtrace
422
426
let compile_safe ctx f =
423
427
let com = ctx.com in
424
428
try
@@ -446,6 +450,12 @@ with
446
450
handle_diagnostics ctx msg null_pos DKCompilerMessage ;
447
451
| Failure msg when not Helper. is_debug_run ->
448
452
error ctx (" Error: " ^ msg) null_pos
453
+ | Globals. Ice (msg ,backtrace ) when is_diagnostics com ->
454
+ let s = make_ice_message com msg backtrace in
455
+ handle_diagnostics ctx s null_pos DKCompilerMessage
456
+ | Globals. Ice (msg ,backtrace ) when not Helper. is_debug_run ->
457
+ let s = make_ice_message com msg backtrace in
458
+ error ctx (" Error: " ^ s) null_pos
449
459
| Helper. HelpMessage msg ->
450
460
print_endline msg
451
461
| Parser. TypePath (p ,c ,is_import ,pos ) ->
@@ -517,7 +527,14 @@ let compile_ctx callbacks ctx =
517
527
catch_completion_and_exit ctx callbacks run
518
528
519
529
let create_context comm cs compilation_step params = {
520
- com = Common. create compilation_step cs version params (DisplayTypes.DisplayMode. create ! Parser. display_mode);
530
+ com = Common. create compilation_step cs {
531
+ version = version;
532
+ major = version_major;
533
+ minor = version_minor;
534
+ revision = version_revision;
535
+ pre = version_pre;
536
+ extra = Version. version_extra;
537
+ } params (DisplayTypes.DisplayMode. create ! Parser. display_mode);
521
538
messages = [] ;
522
539
has_next = false ;
523
540
has_error = false ;
0 commit comments