Skip to content

Commit f45ec35

Browse files
committed
fix res_ast_debugger to unwrap exotic ident names
1 parent 55d2960 commit f45ec35

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

jscomp/syntax/src/res_ast_debugger.ml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ module SexpAst = struct
6666
let longident l =
6767
let rec loop l =
6868
match l with
69-
| Longident.Lident ident -> Sexp.list [Sexp.atom "Lident"; string ident]
69+
| Longident.Lident ident ->
70+
Sexp.list [Sexp.atom "Lident"; string (Ext_ident.unwrap_exotic ident)]
7071
| Longident.Ldot (lident, txt) ->
7172
Sexp.list [Sexp.atom "Ldot"; loop lident; string txt]
7273
| Longident.Lapply (l1, l2) ->
@@ -601,7 +602,7 @@ module SexpAst = struct
601602
Sexp.list
602603
[
603604
Sexp.atom "Pexp_variant";
604-
string lbl;
605+
string (Ext_ident.unwrap_exotic lbl);
605606
(match exprOpt with
606607
| None -> Sexp.atom "None"
607608
| Some expr -> Sexp.list [Sexp.atom "Some"; expression expr]);
@@ -760,7 +761,7 @@ module SexpAst = struct
760761
Sexp.list
761762
[
762763
Sexp.atom "Ppat_variant";
763-
string lbl;
764+
string (Ext_ident.unwrap_exotic lbl);
764765
(match optPattern with
765766
| None -> Sexp.atom "None"
766767
| Some p -> Sexp.list [Sexp.atom "Some"; pattern p]);
@@ -814,7 +815,7 @@ module SexpAst = struct
814815
Sexp.list
815816
[
816817
Sexp.atom "Rtag";
817-
string labelLoc.txt;
818+
string (Ext_ident.unwrap_exotic labelLoc.txt);
818819
attributes attrs;
819820
Sexp.atom (if truth then "true" else "false");
820821
Sexp.list (mapEmpty ~f:coreType types);
@@ -910,11 +911,19 @@ module SexpAst = struct
910911

911912
and attribute (stringLoc, p) =
912913
Sexp.list
913-
[Sexp.atom "attribute"; Sexp.atom stringLoc.Asttypes.txt; payload p]
914+
[
915+
Sexp.atom "attribute";
916+
Sexp.atom (Ext_ident.unwrap_exotic stringLoc.Asttypes.txt);
917+
payload p;
918+
]
914919

915920
and extension (stringLoc, p) =
916921
Sexp.list
917-
[Sexp.atom "extension"; Sexp.atom stringLoc.Asttypes.txt; payload p]
922+
[
923+
Sexp.atom "extension";
924+
Sexp.atom (Ext_ident.unwrap_exotic stringLoc.Asttypes.txt);
925+
payload p;
926+
]
918927

919928
and attributes attrs =
920929
let sexprs = mapEmpty ~f:attribute attrs in

0 commit comments

Comments
 (0)