Repository navigation
Conversation
… escape is one character
In escaped-string mode (how ngtsc lexes an inline template in place) the lexer never made `}` a BLOCK_CLOSE, so a
block never closed. The exception existed because the cursor read `\\u{01}` as separate characters, whose `}` would
otherwise close a block. The cursor now reads a code-point escape (`\\u{X...}`, `\\uXXXX`, `\\xXX`, octal) as the
one character it stands for, as Angular's EscapedCharacterCursor does, and the exception is gone. An escape for NUL
is left to process_escape_sequences, which ends the text there, as Angular's cursor ends input at $EOF.
This file contains hidden or 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
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.
In escaped-string mode (
with_escaped_string, how ngtsc lexes an inline template in place, as the raw text of its string literal), the lexer never turned}intoBLOCK_CLOSE, so a block never closed:lexed with escaped strings gave an unclosed
@ifand an unexpected closing</div>.The exception was there because the escaped cursor read
\u{01}as separate characters, and the}that ends that escape would otherwise close a block. This makes the cursor read a code-point escape (\u{X...},\uXXXX,\xXX, octal) as the one character it stands for, as Angular'sEscapedCharacterCursordoes, and drops the exception. An escape for NUL is left toprocess_escape_sequences, which ends the text there, as Angular's cursor ends input at$EOF.test_block_close_in_escaped_stringcovers a block, a block inside an element, and an escaped}(\u{7d}, which closes a block in Angular too). The conformance suite passes 1264/1264 with its snapshot unchanged, including the variable-length Unicode cases that read\u{...}escapes.