-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Batch File] Fix line continuation (#3999)
* [Batch File] Fix line continuation 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. * [Batch File] Only scope ^ punctuation * [Batch File] Treat first caret after continuation literal 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. * [Batch File] Exclude prototypes from continuation contexts May be of interest, if syntax is extended by template languages.
- Loading branch information
Showing
2 changed files
with
224 additions
and
15 deletions.
There are no files selected for viewing
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 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