Reason: turn strings into quoted strings

Created on 16 Mar 2018  路  3Comments  路  Source: reasonml/reason

This might be an interesting way to help with unicode support.

Translate a normal string in reason:
let str = "涓栫晫"

Into the quoted version of ocaml:
let str = {|涓栫晫|}

Or {js| if you prefer (both work for me, never really known what the difference is)

FEATURE REQUEST Parser

Most helpful comment

All 3 comments

hmm. It's cool that string contents aren't escaped anymore, but according to my read of the bucklescript docs without {js| |js} they'll still be escaped in the final JS output?

https://bucklescript.github.io/docs/en/interop-cheatsheet.html#string-unicode-interpolation

https://bucklescript.github.io/bucklescript/Manual.html#_bucklescript_annotations_for_unicode_and_js_ffi_support

Yup that's true (playground example)
I wonder if the bucklescript repo is the right place for this? seems like it would be nice for all strings to be un-escaped.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yunxing picture yunxing  路  4Comments

cristianoc picture cristianoc  路  4Comments

bobzhang picture bobzhang  路  3Comments

gustavopinto picture gustavopinto  路  3Comments

bluddy picture bluddy  路  3Comments