|
@@ -548,14 +548,14 @@ module StdCallStack = struct
|
|
|
List.iter (fun (pos,kind) ->
|
|
|
let file_pos s =
|
|
|
let line1,col1,_,_ = Lexer.get_pos_coords pos in
|
|
|
- encode_enum_value key_haxe_StackItem 2 [|s;encode_string pos.pfile;vint line1;vint col1|] None
|
|
|
+ encode_enum_value key_haxe_StackItem 2 [|s;create_unknown pos.pfile;vint line1;vint col1|] None
|
|
|
in
|
|
|
match kind with
|
|
|
| EKLocalFunction i ->
|
|
|
let local_function = encode_enum_value key_haxe_StackItem 4 [|vint i|] None in
|
|
|
DynArray.add l (file_pos local_function);
|
|
|
| EKMethod(st,sf) ->
|
|
|
- let local_function = encode_enum_value key_haxe_StackItem 3 [|encode_string (rev_hash_s st); encode_string (rev_hash_s sf)|] None in
|
|
|
+ let local_function = encode_enum_value key_haxe_StackItem 3 [|create_unknown (rev_hash_s st); create_unknown (rev_hash_s sf)|] None in
|
|
|
DynArray.add l (file_pos local_function);
|
|
|
| EKDelayed ->
|
|
|
()
|
|
@@ -789,7 +789,7 @@ module StdEReg = struct
|
|
|
|
|
|
let escape = vfun1 (fun s ->
|
|
|
let s = decode_string s in
|
|
|
- encode_string (Str.quote s)
|
|
|
+ create_unknown (Str.quote s)
|
|
|
)
|
|
|
|
|
|
let map = vifun2 (fun vthis s f ->
|
|
@@ -1158,7 +1158,7 @@ module StdFileSystem = struct
|
|
|
else remove_trailing_slash s
|
|
|
|
|
|
let absolutePath = vfun1 (fun relPath ->
|
|
|
- encode_string (Path.unique_full_path (decode_string relPath))
|
|
|
+ create_unknown (Path.unique_full_path (decode_string relPath))
|
|
|
)
|
|
|
|
|
|
let createDirectory = vfun1 (fun path ->
|
|
@@ -1182,7 +1182,7 @@ module StdFileSystem = struct
|
|
|
)
|
|
|
|
|
|
let fullPath = vfun1 (fun relPath ->
|
|
|
- try encode_string (Extc.get_full_path (decode_string relPath)) with exc -> exc_string (Printexc.to_string exc)
|
|
|
+ try create_unknown (Extc.get_full_path (decode_string relPath)) with exc -> exc_string (Printexc.to_string exc)
|
|
|
)
|
|
|
|
|
|
let isDirectory = vfun1 (fun dir ->
|
|
@@ -1192,7 +1192,7 @@ module StdFileSystem = struct
|
|
|
|
|
|
let readDirectory = vfun1 (fun dir ->
|
|
|
let d = try Sys.readdir (decode_string dir) with Sys_error s -> exc_string s in
|
|
|
- encode_array (Array.to_list (Array.map (fun s -> encode_string s) d))
|
|
|
+ encode_array (Array.to_list (Array.map (fun s -> create_unknown s) d))
|
|
|
)
|
|
|
|
|
|
let rename = vfun2 (fun path newPath ->
|
|
@@ -1353,17 +1353,17 @@ module StdHost = struct
|
|
|
inet_addr_of_string str
|
|
|
|
|
|
let localhost = vfun0 (fun () ->
|
|
|
- encode_string (gethostname())
|
|
|
+ create_unknown (gethostname())
|
|
|
)
|
|
|
|
|
|
let hostReverse = vfun1 (fun ip ->
|
|
|
let ip = decode_i32 ip in
|
|
|
- try encode_string (gethostbyaddr (int32_addr ip)).h_name with Not_found -> exc_string "Could not reverse host"
|
|
|
+ try create_unknown (gethostbyaddr (int32_addr ip)).h_name with Not_found -> exc_string "Could not reverse host"
|
|
|
)
|
|
|
|
|
|
let hostToString = vfun1 (fun ip ->
|
|
|
let ip = decode_i32 ip in
|
|
|
- encode_string (string_of_inet_addr (int32_addr ip))
|
|
|
+ create_unknown (string_of_inet_addr (int32_addr ip))
|
|
|
)
|
|
|
|
|
|
let resolve = vfun1 (fun name ->
|
|
@@ -1704,7 +1704,7 @@ module StdResource = struct
|
|
|
open Common
|
|
|
|
|
|
let listNames = vfun0 (fun () ->
|
|
|
- encode_array (List.map encode_string (hashtbl_keys ((get_ctx()).curapi.MacroApi.get_com()).resources))
|
|
|
+ encode_array (List.map create_unknown (hashtbl_keys ((get_ctx()).curapi.MacroApi.get_com()).resources))
|
|
|
)
|
|
|
|
|
|
let getString = vfun1 (fun name ->
|
|
@@ -2291,7 +2291,7 @@ module StdSys = struct
|
|
|
open Common
|
|
|
|
|
|
let args = vfun0 (fun () ->
|
|
|
- encode_array (List.map encode_string ((get_ctx()).curapi.MacroApi.get_com()).sys_args)
|
|
|
+ encode_array (List.map create_unknown ((get_ctx()).curapi.MacroApi.get_com()).sys_args)
|
|
|
)
|
|
|
|
|
|
let _command = vfun1 (fun cmd ->
|
|
@@ -2306,7 +2306,7 @@ module StdSys = struct
|
|
|
let h = StringHashtbl.create 0 in
|
|
|
Array.iter(fun s ->
|
|
|
let k, v = ExtString.String.split s "=" in
|
|
|
- StringHashtbl.replace h (create_ascii k) (encode_string v)
|
|
|
+ StringHashtbl.replace h (create_ascii k) (create_unknown v)
|
|
|
) env;
|
|
|
encode_string_map_direct h
|
|
|
)
|
|
@@ -2325,12 +2325,18 @@ module StdSys = struct
|
|
|
let getCwd = vfun0 (fun () ->
|
|
|
let dir = Unix.getcwd() in
|
|
|
let l = String.length dir in
|
|
|
- encode_string (if l = 0 then "./" else match dir.[l - 1] with '/' | '\\' -> dir | _ -> dir ^ "/")
|
|
|
+ if l = 0 then
|
|
|
+ encode_string "./"
|
|
|
+ else match dir.[l - 1] with
|
|
|
+ | '/' | '\\' ->
|
|
|
+ create_unknown dir
|
|
|
+ | _ ->
|
|
|
+ create_unknown (dir ^ "/")
|
|
|
)
|
|
|
|
|
|
let getEnv = vfun1 (fun s ->
|
|
|
let s = decode_string s in
|
|
|
- try encode_string (Unix.getenv s) with _ -> vnull
|
|
|
+ try create_unknown (Unix.getenv s) with _ -> vnull
|
|
|
)
|
|
|
|
|
|
let print = vfun1 (fun v ->
|
|
@@ -2354,7 +2360,7 @@ module StdSys = struct
|
|
|
| None -> assert false
|
|
|
| Some p ->
|
|
|
match ctx.curapi.get_type (s_type_path p) with
|
|
|
- | Some(Type.TInst (c, _)) -> encode_string (Extc.get_full_path c.Type.cl_pos.Globals.pfile)
|
|
|
+ | Some(Type.TInst (c, _)) -> create_unknown (Extc.get_full_path c.Type.cl_pos.Globals.pfile)
|
|
|
| _ -> assert false
|
|
|
)
|
|
|
|
|
@@ -2700,12 +2706,12 @@ module StdUtf8 = struct
|
|
|
incr i
|
|
|
) s;
|
|
|
let s = Bytes.unsafe_to_string buf in
|
|
|
- encode_string s
|
|
|
+ create_unknown s
|
|
|
)
|
|
|
|
|
|
let encode = vfun1 (fun s ->
|
|
|
let s = decode_string s in
|
|
|
- encode_string (UTF8.init (String.length s) (fun i -> UChar.of_char s.[i]))
|
|
|
+ create_unknown (UTF8.init (String.length s) (fun i -> UChar.of_char s.[i]))
|
|
|
)
|
|
|
|
|
|
let iter = vfun2 (fun s f ->
|