Closed iBicha closed 4 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"
\u
\u001b[31mHello
Chr(27) + "[31mHello"
I believe we already have something similar. There's a \c that directly corresponds with the char code.
\c
https://github.com/rokucommunity/brighterscript/blob/master/docs/template-strings.md#escaping-unicode-characters
I guess I missed that, thanks!
In js, you can do
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 toChr(27) + "[31mHello"