-
-
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
strip spaces after backslash-escaped newline #41245
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was discussed on Slack with @StefanKarpinski and @BioTurboNick and the general consensus was that stripping all spaces following a backslash-escaped newline would make more sense than the current behavior. One subtle distinction here is whether this stripping should happen before or after triple-quoted strings. Right now it happens after detenting so ```julia """ a\ b""" ``` produces `" ab"`, whereas if it would be the other way around, escaped newlines would not affect detenting so the spaces preceding the `a` would be removed.
simeonschaub
added
needs decision
A decision on this change is needed
parser
Language parsing and surface syntax
strings
"Strings!"
triage
This should be discussed on a triage call
backport 1.7
labels
Jun 16, 2021
Seems like it would make the most sense to have escaped newlines not participate in the dedentation logic, so that:
is equivalent to
|
Agree: it seems better that line continuation and dedent determination not interact, i.e. the line joining should happen before the dedent is determined. |
👍 from triage, also to doing the line joining before dedenting. |
simeonschaub
force-pushed
the
sds/backslash_rm_all_spaces
branch
from
June 17, 2021 21:53
8e6963a
to
5b10327
Compare
simeonschaub
changed the title
RFC: strip spaces after backslash-escaped newline
strip spaces after backslash-escaped newline
Jun 18, 2021
51 tasks
JeffBezanson
approved these changes
Jun 28, 2021
simeonschaub
force-pushed
the
sds/backslash_rm_all_spaces
branch
from
June 29, 2021 13:19
cbd87ec
to
cb2f15f
Compare
KristofferC
pushed a commit
that referenced
this pull request
Jun 30, 2021
This was discussed on Slack with @StefanKarpinski and @BioTurboNick and the general consensus was that stripping all spaces following a backslash-escaped newline would make more sense than the current behavior. Stripping the newline and spaces after a backslash now happens before detenting for triple-quoted srings, so in cases like ```julia """ a\ b c""" ``` the `b` doesn't affect detenting and the spaces before `a` and `c` are removed. (cherry picked from commit be08627)
johanmon
pushed a commit
to johanmon/julia
that referenced
this pull request
Jul 5, 2021
This was discussed on Slack with @StefanKarpinski and @BioTurboNick and the general consensus was that stripping all spaces following a backslash-escaped newline would make more sense than the current behavior. Stripping the newline and spaces after a backslash now happens before detenting for triple-quoted srings, so in cases like ```julia """ a\ b c""" ``` the `b` doesn't affect detenting and the spaces before `a` and `c` are removed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was discussed on Slack with @StefanKarpinski and @BioTurboNick and
the general consensus was that stripping all spaces following a
backslash-escaped newline would make more sense than the current
behavior. Stripping the newline and spaces after a backslash now happens
before detenting for triple-quoted srings, so in cases like
the
b
doesn't affect detenting and the spaces beforea
andc
areremoved.