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

Arg. to avoid escaping backslahes (escape_string) #38597

Merged
merged 6 commits into from
Dec 25, 2020
Merged

Arg. to avoid escaping backslahes (escape_string) #38597

merged 6 commits into from
Dec 25, 2020

Conversation

ronisbr
Copy link
Sponsor Member

@ronisbr ronisbr commented Nov 28, 2020

This commit adds an argument to escape_string to assume that all
backslashes (\\) are already escaped. Hence, \\cdot becomes \\cdot
instead of \\\\cdot.

The default value to this argument is false. Hence, this does not
break any existing code since escape_string behaves exactly the same
as before if no additional option is passed.

Closes #34042

This commit adds an argument to `escape_string` to assume that all
backslashes (`\\`) are already escaped. Hence, `\\cdot` becomes `\\cdot`
instead of `\\\\cdot`.

The default value to this argument is `false`. Hence, this does not
break any existing code since `escape_string` behaves exactly the same
as before if no additional option is passed.

Closes #34042
base/strings/io.jl Outdated Show resolved Hide resolved
@ronisbr
Copy link
Sponsor Member Author

ronisbr commented Nov 29, 2020

I added an untestable test in doc string 😅 Just fixed it now.

@ronisbr
Copy link
Sponsor Member Author

ronisbr commented Dec 7, 2020

Bump!

@ronisbr ronisbr added feature Indicates new feature / enhancement requests strings "Strings!" labels Dec 8, 2020
@Keno Keno added the triage This should be discussed on a triage call label Dec 9, 2020
@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Dec 17, 2020
@JeffBezanson
Copy link
Sponsor Member

Triage is fine with this. I don't really see a downside. Can rebase and merge.

@simeonschaub simeonschaub added the needs compat annotation Add !!! compat "Julia x.y" to the docstring label Dec 17, 2020
@ronisbr
Copy link
Sponsor Member Author

ronisbr commented Dec 19, 2020

Nice! I will try to do this ASAP. I am currently in a place in which the Internet connection is very unstable.

@ronisbr
Copy link
Sponsor Member Author

ronisbr commented Dec 20, 2020

Done!

@ronisbr ronisbr removed the needs compat annotation Add !!! compat "Julia x.y" to the docstring label Dec 20, 2020
@ronisbr
Copy link
Sponsor Member Author

ronisbr commented Dec 21, 2020

The failure in aarch64 is in the REPL tests and does not seem related to this PR.

@Keno Keno merged commit 60b68ce into JuliaLang:master Dec 25, 2020
@ronisbr ronisbr deleted the escape_string branch December 26, 2020 01:21
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
* Arg. to avoid escaping backslahes (escape_string)

This commit adds an argument to `escape_string` to assume that all
backslashes (`\\`) are already escaped. Hence, `\\cdot` becomes `\\cdot`
instead of `\\\\cdot`.

The default value to this argument is `false`. Hence, this does not
break any existing code since `escape_string` behaves exactly the same
as before if no additional option is passed.

Closes JuliaLang#34042

* Replace `bsescaped` arg. with `keep` keyword

* Update NEWS.md

* Fix doc tests

* Add compat annotation

Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates new feature / enhancement requests strings "Strings!"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to escape_string to avoid already escaped characters
4 participants