Skip to content

Commit 80b0327

Browse files
cometkimcristianoc
authored andcommitted
rename function
1 parent 9de5335 commit 80b0327

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

jscomp/ext/ext_ident.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ let is_uident name =
140140
| _ -> false
141141
else false
142142

143-
let is_exotic name =
143+
let is_uppercase_exotic name =
144144
let len = String.length name in
145145
len >= 3
146146
&& name.[0] = '\\'
147147
&& name.[1] = '\"'
148148
&& name.[len - 1] = '\"'
149149

150-
let unwrap_exotic name =
151-
if is_exotic name then
150+
let unwrap_uppercase_exotic name =
151+
if is_uppercase_exotic name then
152152
let len = String.length name in
153153
String.sub name 2 (len - 3)
154154
else name

jscomp/ext/ext_ident.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ val make_unused : unit -> Ident.t
5050

5151
val is_uident : string -> bool
5252

53-
val is_exotic : string -> bool
53+
val is_uppercase_exotic : string -> bool
5454

55-
val unwrap_exotic : string -> string
55+
val unwrap_uppercase_exotic : string -> string
5656

5757
(**
5858
Invariant: if name is not converted, the reference should be equal

jscomp/syntax/src/res_ast_debugger.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ module SexpAst = struct
5454
| [] -> [Sexp.list []]
5555
| items -> List.map f items
5656

57-
let string txt = Sexp.atom ("\"" ^ Ext_ident.unwrap_exotic txt ^ "\"")
57+
let string txt =
58+
Sexp.atom ("\"" ^ Ext_ident.unwrap_uppercase_exotic txt ^ "\"")
5859

5960
let char c = Sexp.atom ("'" ^ Char.escaped c ^ "'")
6061

jscomp/syntax/src/res_printer.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ let classifyIdentContent ?(allowUident = false) ?(allowHyphen = false) txt =
399399
loop 0
400400

401401
let printIdentLike ?allowUident ?allowHyphen txt =
402-
let txt = Ext_ident.unwrap_exotic txt in
402+
let txt = Ext_ident.unwrap_uppercase_exotic txt in
403403
match classifyIdentContent ?allowUident ?allowHyphen txt with
404404
| ExoticIdent -> Doc.concat [Doc.text "\\\""; Doc.text txt; Doc.text "\""]
405405
| NormalIdent -> Doc.text txt
@@ -433,7 +433,7 @@ let printPolyVarIdent txt =
433433
(* numeric poly-vars don't need quotes: #644 *)
434434
if isValidNumericPolyvarNumber txt then Doc.text txt
435435
else
436-
let txt = Ext_ident.unwrap_exotic txt in
436+
let txt = Ext_ident.unwrap_uppercase_exotic txt in
437437
match classifyIdentContent ~allowUident:true txt with
438438
| ExoticIdent -> Doc.concat [Doc.text "\""; Doc.text txt; Doc.text "\""]
439439
| NormalIdent -> (

jscomp/syntax/src/res_scanner.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ let scanExoticIdentifier scanner =
310310
let ident =
311311
(String.sub [@doesNotRaise]) scanner.src startOff (scanner.offset - startOff)
312312
in
313-
let name = Ext_ident.unwrap_exotic ident in
313+
let name = Ext_ident.unwrap_uppercase_exotic ident in
314314
if name = String.empty then (
315315
let endPos = position scanner in
316316
scanner.err ~startPos ~endPos

0 commit comments

Comments
 (0)