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 =
38
38
}
39
39
40
40
let 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
42
42
43
43
type elem_mode =
44
44
| Elem_passive
Original file line number Diff line number Diff line change @@ -36,6 +36,28 @@ type _ indice =
36
36
37
37
let pp_id fmt id = pf fmt " $%s" id
38
38
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
+
39
61
let pp_id_opt fmt = function None -> () | Some i -> pf fmt " %a" pp_id i
40
62
41
63
let pp_indice (type kind ) fmt : kind indice -> unit = function
Original file line number Diff line number Diff line change 21
21
[23 ]
22
22
$ owi script -- no-exhaustion reference/ proposals/ gc/ ref_eq. wast
23
23
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
25
25
26
26
[125 ]
27
27
$ owi script -- no-exhaustion reference/ proposals/ gc/ ref_test. wast
You can’t perform that action at this time.
0 commit comments