-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix #35305, need escaping when printing string macro calls #35309
Conversation
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 don't think this actually fixes it, because of #29580, but it is better.
It looks like that is about printing
But I should change this to only escape backslashes and quotes I think. |
893831e
to
0da4b9d
Compare
True, but those happen to be Also, some part of that fix is included in https://github.com/JuliaLang/julia/pull/34111/files#diff-85598a9f3fb3fcced8c43d0472c30888R545 |
Oh, nice, we should add that code and use it here. |
Implementation of the raw-string escaping convention. Can also be used to escape command-line arguments for Windows C/C++/Julia applications, which use the same \" escaping convention as Julia non-standard string literals.
0da4b9d
to
b6dd448
Compare
Added the commit from #34111. I edited it a bit to not print surrounding |
@JeffBezanson The reason I printed the surrounding |
That makes sense, but it's easy to add the quotes if you want them, and impossible to remove them if you don't (however unlikely that might be). |
write(io, '\\') | ||
escapes -= 1 | ||
end | ||
escapes = 0 |
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.
Looks like this line is unecessary since escape is decremented to 0 by L559
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.
Agreed.
fix #35305