File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ type data =
3838 }
3939
4040let pp_data fmt (d : data ) =
41- pf fmt {| (data% a % a % S )| } pp_id_opt d.id pp_data_mode d.mode d.init
41+ pf fmt {| (data% a % a % a )| } pp_id_opt d.id pp_data_mode d.mode pp_name d.init
4242
4343type elem_mode =
4444 | Elem_passive
Original file line number Diff line number Diff line change @@ -36,6 +36,28 @@ type _ indice =
3636
3737let pp_id fmt id = pf fmt " $%s" id
3838
39+ let pp_name fmt s =
40+ let pp_hex_char fmt c = pf fmt " \\ %02x" (Char. code c) in
41+ let pp_char fmt = function
42+ | '\n' -> string fmt " \\ n"
43+ | '\t' -> string fmt " \\ t"
44+ | '\r' -> string fmt " \\ r"
45+ | '\"' -> string fmt " \\\" "
46+ | '\\' -> string fmt " \\\\ "
47+ | c ->
48+ let ci = Char. code c in
49+ if 0x20 < = ci && ci < 0x7f then char fmt c else pp_hex_char fmt c
50+ in
51+ let pp_unicode_char fmt = function
52+ | (0x09 | 0x0a ) as c -> pp_char fmt (Char. chr c)
53+ | uc when 0x20 < = uc && uc < 0x7f -> pp_char fmt (Char. chr uc)
54+ | uc -> pf fmt " \\ u{%02x}" uc
55+ in
56+ let pp_string fmt s =
57+ String. iter (fun c -> pp_unicode_char fmt (Char. code c)) s
58+ in
59+ pf fmt {| " %a" | } pp_string s
60+
3961let pp_id_opt fmt = function None -> () | Some i -> pf fmt " %a" pp_id i
4062
4163let pp_indice (type kind ) fmt : kind indice -> unit = function
Original file line number Diff line number Diff line change 2121 [23 ]
2222 $ owi script -- no-exhaustion reference/ proposals/ gc/ ref_eq. wast
2323 owi: internal error, uncaught exception:
24- File " src/ast/types.ml" , line 923 , characters 12 -18: Assertion failed
24+ File " src/ast/types.ml" , line 945 , characters 12 -18: Assertion failed
2525
2626 [125 ]
2727 $ owi script -- no-exhaustion reference/ proposals/ gc/ ref_test. wast
You can’t perform that action at this time.
0 commit comments