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

String representation of expressions with quotes in non-standard string literals #35305

Closed
pfarndt opened this issue Mar 30, 2020 · 2 comments · Fixed by #35309
Closed

String representation of expressions with quotes in non-standard string literals #35305

pfarndt opened this issue Mar 30, 2020 · 2 comments · Fixed by #35309
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects. regression Regression in behavior compared to a previous version

Comments

@pfarndt
Copy link
Contributor

pfarndt commented Mar 30, 2020

The string representation of an expression that contains quotes " in triple-quoted non-standard string literals (or escaped quotes in quoted non-standard string literals) is not faithfully any more. The resulting text does not represent valid Julia code and cannot be included again. in Julia v1.4

julia> print(:(r = r"""45 " """))
r = r"45 " "
julia> print(:(r = r"45 \" "))
r = r"45 " "

This does not happen for "normal" strings

julia> print(:(r = "45 \" "))
r = "45 \" "

and also used to work in Julia v1.3.1. See also https://discourse.julialang.org/t/string-representation-of-expression/36729/3?u=pfarndt

@StefanKarpinski StefanKarpinski added bug Indicates an unexpected problem or unintended behavior strings "Strings!" labels Mar 30, 2020
@StefanKarpinski
Copy link
Member

@JeffBezanson, I don't recall many changes to string literals aside from the recent one you did for multiline string literals. Any possibility that might have affected this?

@JeffBezanson JeffBezanson added display and printing Aesthetics and correctness of printed representations of objects. regression Regression in behavior compared to a previous version and removed strings "Strings!" labels Mar 30, 2020
@JeffBezanson
Copy link
Member

It's a printing issue; #32423.

@JeffBezanson JeffBezanson self-assigned this Mar 30, 2020
JeffBezanson added a commit that referenced this issue Mar 31, 2020
fix #35305, need escaping when printing string macro calls
KristofferC pushed a commit that referenced this issue Apr 4, 2020
ravibitsgoa pushed a commit to ravibitsgoa/julia that referenced this issue Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects. regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants