Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Escape Sequence is written wrong #2

Open
jgy90 opened this issue Jul 28, 2023 · 0 comments
Open

[BUG] Escape Sequence is written wrong #2

jgy90 opened this issue Jul 28, 2023 · 0 comments

Comments

@jgy90
Copy link

jgy90 commented Jul 28, 2023

when string is \t or \n, if i convert unicode escape to character, it come out just t not \t

if (hadSlash) {
// handle an escaped value
hadSlash = false
when (ch) {
'u' -> inUnicode = true
else -> out.write(ch.toInt())
}
continue
} else if (ch == '\\') {
hadSlash = true
continue
}

if hadSlash is true but ch is not u, then \\ should write before ch

else -> out.write('\\' + ch.toInt()) 

Consider it please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant