-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
@@ -192,7 +192,7 @@ let rec longident f = function | |||
let longident_loc f x = pp f "%a" longident x.txt | |||
|
|||
let constant f = function | |||
| Pconst_char i -> pp f "%C" i | |||
| Pconst_char i -> pp f "%C" (Char.unsafe_chr i) (* todo: consider safety *) | |||
| Pconst_string (i, None) -> pp f "%S" i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -553,7 +553,7 @@ let printConstant ?(templateLiteral = false) c = | |||
| Pconst_float (s, _) -> Doc.text s | |||
| Pconst_char c -> | |||
let str = | |||
match c with | |||
match Char.unsafe_chr c with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's still a unsafe_char
usage, but I think this one is safe because it's just value testing and no I/O is involved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems okay, but there may be some duplication with string_of_int_as_char, you may do a clean up later after this commit landed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
Cooperative PR with rescript-lang/rescript#5759