Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign updisallow unrecognized string/char escapes #22800
Conversation
stevengj
added
breaking
parser
labels
Jul 13, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
(Note that I found a few bugs this way.) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevengj
Jul 14, 2017
Member
I don't really understand the Travis failures. One appears to be a timeout, whereas the other is the mysterious:
From worker 1: compile: Test Failed
Expression: Foo.g() === 97.0
Evaluated: 2.0 === 97.0
Stacktrace:
[1] (::Test62Main_compile.##1#14)() at /tmp/julia/share/julia/test/compile.jl:159
AppVeyor and FreeBSD and OSX Travis succeeded; is there some problem with Linux Travis now?
|
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? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vtjnash
Jul 14, 2017
Member
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Travis is failing in all kinds of ways lately. |
JeffBezanson
merged commit 7cb02cd
into
JuliaLang:master
Jul 14, 2017
stevengj
deleted the
stevengj:invalidescapes
branch
Jul 14, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
StefanKarpinski
Jul 17, 2017
Member
The fact that this revealed a bunch of bugs is a pretty good indicator that this was a good idea.
|
The fact that this revealed a bunch of bugs is a pretty good indicator that this was a good idea. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevengj
Jul 19, 2017
Member
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...
|
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... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
JeffBezanson
Jul 19, 2017
Member
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
StefanKarpinski
Jul 19, 2017
Member
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.
|
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. |
added a commit
to JuliaCloud/AWSSDK.jl
that referenced
this pull request
Aug 20, 2017
added a commit
to JuliaCloud/AWSCore.jl
that referenced
this pull request
Aug 20, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ChrisRackauckas
Apr 6, 2018
Contributor
Did this cause math blocks to no longer work?
"""
calculate_residuals!(out, ũ, u₀, u₁, α, ρ)
Save element-wise residuals
```math
\frac{ũ}{α+\max{|u₀|,|u₁|}*ρ}
```
in `out`.
"""
function calculate_residuals!(out, ũ, u₀, u₁, α, ρ, internalnorm)
@. out = ũ / (α + max(internalnorm(u₀), internalnorm(u₁)) * ρ)
end
ERROR: syntax: invalid escape sequence
|
Did this cause math blocks to no longer work?
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Just escape the backslash? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ChrisRackauckas
Apr 6, 2018
Contributor
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)
|
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) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevengj
Apr 6, 2018
Member
Note that \frac didn't work previously, either; it would have given frac since \f was equivalent to f. So, throwing an error instead caught a bug.
However, you can just use doc"..." to avoid the need for backslash escapes.
doc"""
calculate_residuals!(out, ũ, u₀, u₁, α, ρ)
Save element-wise residuals
```math
\frac{ũ}{α+\max{|u₀|,|u₁|}*ρ}
```
in `out`.
"""|
Note that However, you can just use doc"""
calculate_residuals!(out, ũ, u₀, u₁, α, ρ)
Save element-wise residuals
```math
\frac{ũ}{α+\max{|u₀|,|u₁|}*ρ}
```
in `out`.
""" |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevengj
Apr 6, 2018
Member
The manual has a brief comment about this:
@doc_strshould only be used when the docstring contains$or\characters that should not be parsed by Julia such as LaTeX syntax or Julia source code examples containing interpolation.
|
The manual has a brief comment about this:
|
stevengj commentedJul 13, 2017
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*∈ {',",`,$,\}.