There's a bug with the lexer or parser for nested curly braces in template strings. Here's a test that is currently failing, but should pass.
it.only('handles nested curly braces', () => {
let tokens = Lexer.scan('thing = `${{}}`').tokens;
expect(tokens.map(x => x.kind)).to.eql([
TokenKind.Identifier,
TokenKind.Equal,
TokenKind.BackTick,
TokenKind.TemplateStringQuasi,
TokenKind.TemplateStringExpressionBegin,
TokenKind.LeftCurlyBrace,
TokenKind.RightCurlyBrace,
TokenKind.TemplateStringExpressionEnd,
TokenKind.TemplateStringQuasi,
TokenKind.BackTick,
TokenKind.Eof
]);
});
Requirements:
- fix the lexer or parser to ensure that this syntax is supported
- ensure the existing unit tests all pass without needing to modify them, since that would be backwards breaking changes
- write new unit tests to ensure this behavior doesn't break again in the future.
There's a bug with the lexer or parser for nested curly braces in template strings. Here's a test that is currently failing, but should pass.
Requirements: