rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
160 stars 46 forks source link

Handle unicode escape sequence in template strings #1080

Closed iBicha closed 4 months ago

iBicha commented 7 months ago

In js, you can do

console.log(`\u001b[31mHello`)

and it would print a red hello.

Brighterscript can parse \u escape sequence and replace it with the right Chr calls. E.g. \u001b[31mHello can be transpilied to Chr(27) + "[31mHello"

TwitchBronBron commented 4 months ago

I believe we already have something similar. There's a \c that directly corresponds with the char code.

https://github.com/rokucommunity/brighterscript/blob/master/docs/template-strings.md#escaping-unicode-characters

iBicha commented 4 months ago

I guess I missed that, thanks!