@@ -66,7 +66,8 @@ module SexpAst = struct
66
66
let longident l =
67
67
let rec loop l =
68
68
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)]
70
71
| Longident. Ldot (lident , txt ) ->
71
72
Sexp. list [Sexp. atom " Ldot" ; loop lident; string txt]
72
73
| Longident. Lapply (l1 , l2 ) ->
@@ -601,7 +602,7 @@ module SexpAst = struct
601
602
Sexp. list
602
603
[
603
604
Sexp. atom " Pexp_variant" ;
604
- string lbl;
605
+ string ( Ext_ident. unwrap_exotic lbl) ;
605
606
(match exprOpt with
606
607
| None -> Sexp. atom " None"
607
608
| Some expr -> Sexp. list [Sexp. atom " Some" ; expression expr]);
@@ -760,7 +761,7 @@ module SexpAst = struct
760
761
Sexp. list
761
762
[
762
763
Sexp. atom " Ppat_variant" ;
763
- string lbl;
764
+ string ( Ext_ident. unwrap_exotic lbl) ;
764
765
(match optPattern with
765
766
| None -> Sexp. atom " None"
766
767
| Some p -> Sexp. list [Sexp. atom " Some" ; pattern p]);
@@ -814,7 +815,7 @@ module SexpAst = struct
814
815
Sexp. list
815
816
[
816
817
Sexp. atom " Rtag" ;
817
- string labelLoc.txt;
818
+ string ( Ext_ident. unwrap_exotic labelLoc.txt) ;
818
819
attributes attrs;
819
820
Sexp. atom (if truth then " true" else " false" );
820
821
Sexp. list (mapEmpty ~f: coreType types);
@@ -910,11 +911,19 @@ module SexpAst = struct
910
911
911
912
and attribute (stringLoc , p ) =
912
913
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
+ ]
914
919
915
920
and extension (stringLoc , p ) =
916
921
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
+ ]
918
927
919
928
and attributes attrs =
920
929
let sexprs = mapEmpty ~f: attribute attrs in
0 commit comments