-
Notifications
You must be signed in to change notification settings - Fork 591
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
[Batch File] Fix line continuation #3999
Merged
deathaxe
merged 4 commits into
sublimehq:master
from
deathaxe:pr/batch/fix-line-continuation
Jul 9, 2024
Merged
[Batch File] Fix line continuation #3999
deathaxe
merged 4 commits into
sublimehq:master
from
deathaxe:pr/batch/fix-line-continuation
Jul 9, 2024
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 commit applies the following rule: If `^` appears at the end of a line, the linefeed is stripped and the next character is escaped or uses its special meaning, if any. If the next character is also a linefeed, it is treated literal. REM command seems to be working special by line continuation working only directly after the first token.
deathaxe
force-pushed
the
pr/batch/fix-line-continuation
branch
from
June 22, 2024 15:30
b6d0505
to
b82c178
Compare
mataha
reviewed
Jun 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaner than what I was attempting. I have a few comments though.
A caret (`^`) at the beginning of a continued line is printed literal as it is escaped by the continuing caret after stripping newline character. 1. It does not introduce an escape sequence. 2. It is not scoped `constant.character.escape` as it is just printed as is. 3. It differs from `^^` escape sequences by escaping caret already being scoped `punctuation.separator.continuation.line`. Rule ==== Escaped <LF> - <LF> is stripped - The next character is escaped. If at the end of line buffer, then the next line is read and processed by phases 1 and 1.5 and appended to the current one before escaping the next character. Note: Due to `^` being treated special, only at beginning of line, this construct won't be supported properly under all circumstances when embedding batch syntax into Markdown or any other syntax, with probably indented code blocks.
May be of interest, if syntax is extended by template languages.
mataha
approved these changes
Jun 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
michaelblyons
approved these changes
Jun 26, 2024
jrappen
approved these changes
Jul 4, 2024
FichteFoll
approved these changes
Jul 9, 2024
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 commit applies the following rule:
If
^
appears at the end of a line, the linefeed is stripped and the next character is escaped or uses its special meaning, if any. If the next character is also a linefeed, it is treated literal.REM command seems to be working special by line continuation working only directly after the first token.