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
249
249
let to_string (t : t ) =
250
250
bs_external ^ Marshal. to_string t []
251
251
252
-
253
- (* TODO: better error message when version mismatch *)
254
- let from_string s : t =
252
+ let is_bs_primitive s =
255
253
let s_len = String. length s in
256
- if s_len > = bs_prefix_length &&
254
+ s_len > = bs_prefix_length &&
257
255
String. unsafe_get s 0 = 'B' &&
258
256
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
260
272
Marshal. from_string s bs_external_length
261
273
else Ffi_normal
262
274
You can’t perform that action at this time.
0 commit comments