We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
String.sub
unwrap_uppercase_exotic
1 parent a3f202c commit a9a8372Copy full SHA for a9a8372
jscomp/syntax/src/res_printer.ml
@@ -434,12 +434,10 @@ let printPolyVarIdent txt =
434
else
435
match classifyIdentContent ~allowUident:true txt with
436
| UppercaseExoticIdent ->
437
- Doc.concat
438
- [
439
- Doc.text "\"";
440
- Doc.text (Ext_ident.unwrap_uppercase_exotic txt);
441
442
- ]
+ let len = String.length txt in
+ (* UppercaseExoticIdent follows the \"..." format,
+ so removing the leading backslash is enough to transform it into polyvar style *)
+ Doc.text ((String.sub [@doesNotRaise]) txt 1 (len - 1))
443
| ExoticIdent -> Doc.concat [Doc.text "\""; Doc.text txt; Doc.text "\""]
444
| NormalIdent -> (
445
match txt with
0 commit comments