-
-
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
disallow unrecognized string/char escapes #22800
Conversation
(Note that I found a few bugs this way.) |
I don't really understand the Travis failures. One appears to be a timeout, whereas the other is the mysterious:
AppVeyor and FreeBSD and OSX Travis succeeded; is there some problem with Linux Travis now? |
We've seen that one before. It seems to suggest we're losing a backedge at some point (stochastically), but we haven't reproduced it yet locally. |
Travis is failing in all kinds of ways lately. |
The fact that this revealed a bunch of bugs is a pretty good indicator that this was a good idea. |
There was a suggestion on discourse that this should be changed to a warning. On the one hand, it seems like virtually all the errors that are popping up are bugs. On the other hand, we normally make changes like this a warning for a while... |
These are very easy to fix, and the fixed code is both backwards and forwards compatible, so it doesn't seem so crucial to me to give a warning. |
Especially since when someone upgrades to 0.7, they should fix all warnings and then upgrade to 1.0, at which point this would fail anyway. There's even a case to be made that 0.7 should have depwarn=error on by default, but that's a different discussion. |
Did this cause math blocks to no longer work?
|
Just escape the backslash? |
Having to go and escape the TeX code in every docstring is a pretty heavy handed workaround. For normal strings you'd just use LaTeXStrings.jl. Is there no simple way to write TeX in docstrings now? (Do string macros work on docstrings? I guess I never checked) |
Note that However, you can just use doc"""
calculate_residuals!(out, ũ, u₀, u₁, α, ρ)
Save element-wise residuals
```math
\frac{ũ}{α+\max{|u₀|,|u₁|}*ρ}
```
in `out`.
""" |
The manual has a brief comment about this:
|
As discussed in #21284, this PR disallows a backslash in string or character literals before unrecognized escape characters.
Besides the standard escapes that produce a different character (e.g.
\n
), the only allowed escapes where\*
produces*
are now for*
∈ {'
,"
,`
,$
,\
}.