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 10146ef commit 636f978Copy full SHA for 636f978
jscomp/syntax/src/res_printer.ml
@@ -436,12 +436,10 @@ let print_poly_var_ident txt =
436
else
437
match classify_ident_content ~allow_uident:true txt with
438
| UppercaseExoticIdent ->
439
- Doc.concat
440
- [
441
- Doc.text "\"";
442
- Doc.text (Ext_ident.unwrap_uppercase_exotic txt);
443
444
- ]
+ 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))
445
| ExoticIdent -> Doc.concat [Doc.text "\""; Doc.text txt; Doc.text "\""]
446
| NormalIdent -> (
447
match txt with
0 commit comments