|
@@ -932,6 +932,7 @@ try
|
|
let pre_compilation = ref [] in
|
|
let pre_compilation = ref [] in
|
|
let interp = ref false in
|
|
let interp = ref false in
|
|
let swf_version = ref false in
|
|
let swf_version = ref false in
|
|
|
|
+ let evals = ref [] in
|
|
Common.define_value com Define.HaxeVer (float_repres (float_of_int version /. 1000.));
|
|
Common.define_value com Define.HaxeVer (float_repres (float_of_int version /. 1000.));
|
|
Common.define_value com Define.HxcppApiLevel "312";
|
|
Common.define_value com Define.HxcppApiLevel "312";
|
|
Common.raw_define com "haxe3";
|
|
Common.raw_define com "haxe3";
|
|
@@ -1205,6 +1206,10 @@ try
|
|
force_typing := true;
|
|
force_typing := true;
|
|
config_macros := e :: !config_macros
|
|
config_macros := e :: !config_macros
|
|
)," : call the given macro before typing anything else");
|
|
)," : call the given macro before typing anything else");
|
|
|
|
+ ("--eval", Arg.String (fun s ->
|
|
|
|
+ force_typing := true;
|
|
|
|
+ evals := s :: !evals;
|
|
|
|
+ ), " : evaluates argument as Haxe module code");
|
|
("--wait", Arg.String (fun hp ->
|
|
("--wait", Arg.String (fun hp ->
|
|
let host, port = (try ExtString.String.split hp ":" with _ -> "127.0.0.1", hp) in
|
|
let host, port = (try ExtString.String.split hp ":" with _ -> "127.0.0.1", hp) in
|
|
wait_loop com host (try int_of_string port with _ -> raise (Arg.Bad "Invalid port"))
|
|
wait_loop com host (try int_of_string port with _ -> raise (Arg.Bad "Invalid port"))
|
|
@@ -1400,6 +1405,7 @@ try
|
|
Typecore.type_expr_ref := (fun ctx e with_type -> Typer.type_expr ctx e with_type);
|
|
Typecore.type_expr_ref := (fun ctx e with_type -> Typer.type_expr ctx e with_type);
|
|
let tctx = Typer.create com in
|
|
let tctx = Typer.create com in
|
|
List.iter (Typer.call_init_macro tctx) (List.rev !config_macros);
|
|
List.iter (Typer.call_init_macro tctx) (List.rev !config_macros);
|
|
|
|
+ List.iter (Typer.eval tctx) !evals;
|
|
List.iter (fun cpath -> ignore(tctx.Typecore.g.Typecore.do_load_module tctx cpath Ast.null_pos)) (List.rev !classes);
|
|
List.iter (fun cpath -> ignore(tctx.Typecore.g.Typecore.do_load_module tctx cpath Ast.null_pos)) (List.rev !classes);
|
|
Typer.finalize tctx;
|
|
Typer.finalize tctx;
|
|
t();
|
|
t();
|