-
Notifications
You must be signed in to change notification settings - Fork 165
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
why \v
is getting converted into \u000b
during asr_to_c conversion
#2375
Comments
Merged
The following might fix it: diff --git a/src/libasr/string_utils.cpp b/src/libasr/string_utils.cpp
index 073167d16..55e5a6b2a 100644
--- a/src/libasr/string_utils.cpp
+++ b/src/libasr/string_utils.cpp
@@ -142,6 +142,7 @@ std::string str_escape_c(const std::string &s) {
case '\n': o << "\\n"; break;
case '\r': o << "\\r"; break;
case '\t': o << "\\t"; break;
+ case '\v': o << "\\v"; break;
default:
if ('\x00' <= *c && *c <= '\x1f') {
o << "\\u" |
MRE: from sympy import pi, Symbol, S
def main0():
x: str = 'Hel\vlo'
print(x)
main0() LLVM $ lpython examples/expr2.py
Hel
lo C $ lpython examples/expr2.py --backend=c
expr2__tmp__generated__.c:17:30: error: universal character name refers to a control character
_lfortran_strcpy(&x, "Hel\u000blo", 1);
^~~~~~
1 error generated.
The command 'gcc -o expr2.out expr2__tmp__generated__.c -I /Users/thirumalai/Open_Source/lpython/src/bin/../libasr/runtime -L"/Users/thirumalai/Open_Source/lpython/src/bin/../runtime" -Wl,-rpath,"/Users/thirumalai/Open_Source/lpython/src/bin/../runtime" -llpython_runtime -lm' failed. |
should I add a PR for the same and revert my changes? |
Since it is just a one-line change, I would include it in existing PR #2373. |
okay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got below error while using
ch=='\v'
please debug why?
Edit:
isspace
issue was related to name mangling, so I removed it.The text was updated successfully, but these errors were encountered: