- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38
Change char payload #709
Change char payload #709
Conversation
| 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
| | 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