File tree 5 files changed +10
-9
lines changed
5 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -140,15 +140,15 @@ let is_uident name =
140
140
| _ -> false
141
141
else false
142
142
143
- let is_exotic name =
143
+ let is_uppercase_exotic name =
144
144
let len = String. length name in
145
145
len > = 3
146
146
&& name.[0 ] = '\\'
147
147
&& name.[1 ] = '\"'
148
148
&& name.[len - 1 ] = '\"'
149
149
150
- let unwrap_exotic name =
151
- if is_exotic name then
150
+ let unwrap_uppercase_exotic name =
151
+ if is_uppercase_exotic name then
152
152
let len = String. length name in
153
153
String. sub name 2 (len - 3 )
154
154
else name
Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ val make_unused : unit -> Ident.t
50
50
51
51
val is_uident : string -> bool
52
52
53
- val is_exotic : string -> bool
53
+ val is_uppercase_exotic : string -> bool
54
54
55
- val unwrap_exotic : string -> string
55
+ val unwrap_uppercase_exotic : string -> string
56
56
57
57
(* *
58
58
Invariant: if name is not converted, the reference should be equal
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ module SexpAst = struct
54
54
| [] -> [Sexp. list []]
55
55
| items -> List. map f items
56
56
57
- let string txt = Sexp. atom (" \" " ^ Ext_ident. unwrap_exotic txt ^ " \" " )
57
+ let string txt =
58
+ Sexp. atom (" \" " ^ Ext_ident. unwrap_uppercase_exotic txt ^ " \" " )
58
59
59
60
let char c = Sexp. atom (" '" ^ Char. escaped c ^ " '" )
60
61
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ let classifyIdentContent ?(allowUident = false) ?(allowHyphen = false) txt =
399
399
loop 0
400
400
401
401
let printIdentLike ?allowUident ?allowHyphen txt =
402
- let txt = Ext_ident. unwrap_exotic txt in
402
+ let txt = Ext_ident. unwrap_uppercase_exotic txt in
403
403
match classifyIdentContent ?allowUident ?allowHyphen txt with
404
404
| ExoticIdent -> Doc. concat [Doc. text " \\\" " ; Doc. text txt; Doc. text " \" " ]
405
405
| NormalIdent -> Doc. text txt
@@ -433,7 +433,7 @@ let printPolyVarIdent txt =
433
433
(* numeric poly-vars don't need quotes: #644 *)
434
434
if isValidNumericPolyvarNumber txt then Doc. text txt
435
435
else
436
- let txt = Ext_ident. unwrap_exotic txt in
436
+ let txt = Ext_ident. unwrap_uppercase_exotic txt in
437
437
match classifyIdentContent ~allow Uident:true txt with
438
438
| ExoticIdent -> Doc. concat [Doc. text " \" " ; Doc. text txt; Doc. text " \" " ]
439
439
| NormalIdent -> (
Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ let scanExoticIdentifier scanner =
310
310
let ident =
311
311
(String. sub [@ doesNotRaise]) scanner.src startOff (scanner.offset - startOff)
312
312
in
313
- let name = Ext_ident. unwrap_exotic ident in
313
+ let name = Ext_ident. unwrap_uppercase_exotic ident in
314
314
if name = String. empty then (
315
315
let endPos = position scanner in
316
316
scanner.err ~start Pos ~end Pos
You can’t perform that action at this time.
0 commit comments