-
Notifications
You must be signed in to change notification settings - Fork 158
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
WASM: Unescape string #1756
WASM: Unescape string #1756
Conversation
@@ -2084,8 +2084,9 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> { | |||
} | |||
|
|||
void visit_StringConstant(const ASR::StringConstant_t &x) { | |||
emit_string(x.m_s); | |||
m_wa.emit_i32_const(m_string_to_iov_loc_map[x.m_s]); | |||
std::string s = unescape_string(m_al, x.m_s); |
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.
The string should have been unescaped in ASR already. See #1759.
So the proper fix for this is to fix the frontend to keep the string unescaped.
@@ -295,7 +295,7 @@ RUN(NAME exit_02b FAIL LABELS cpython llvm c wasm wasm_x86 wasm_x64) | |||
RUN(NAME exit_02c FAIL LABELS cpython llvm c) | |||
|
|||
# Test all four backends | |||
RUN(NAME print_01 LABELS cpython llvm c wasm) # wasm not yet supports sep and end keywords | |||
RUN(NAME print_01 LABELS cpython llvm c wasm wasm_x86 wasm_x64) |
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.
this change is good
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.
I will enable this test in one of the upcoming PRs.
Closing in favour of #1762. |
Expected:
Main branch:
PR branch: