File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -249,14 +249,26 @@ let bs_external_length = String.length bs_external
249249let to_string (t : t ) =
250250 bs_external ^ Marshal. to_string t []
251251
252-
253- (* TODO: better error message when version mismatch *)
254- let from_string s : t =
252+ let is_bs_primitive s =
255253 let s_len = String. length s in
256- if s_len > = bs_prefix_length &&
254+ s_len > = bs_prefix_length &&
257255 String. unsafe_get s 0 = 'B' &&
258256 String. unsafe_get s 1 = 'S' &&
259- String. unsafe_get s 2 = ':' then
257+ String. unsafe_get s 2 = ':'
258+
259+
260+ let () = Oprint. map_primitive_name :=
261+ #if BS_RELEASE_BUILD then
262+ (fun s ->
263+ if is_bs_primitive s then " BS:external"
264+ else s )
265+ #else
266+ (fun s -> String. escaped s)
267+ #end
268+
269+ (* TODO: better error message when version mismatch *)
270+ let from_string s : t =
271+ if is_bs_primitive s then
260272 Marshal. from_string s bs_external_length
261273 else Ffi_normal
262274
You can’t perform that action at this time.
0 commit comments