mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibJS: Add TokenType::TemplateLiteral
This is required for template literals - we're not quite there yet, but at least the parser can now tell us when this token is encountered - currently this yields "Unexpected token Invalid". Not really helpful. The character is a "backtick", but as we already have TokenType::{StringLiteral,RegexLiteral} this seemed like a fitting name. This also enables syntax highlighting for template literals in the js REPL and LibGUI's JSSyntaxHighlighter.
This commit is contained in:
parent
57caca3171
commit
95b51e857d
Notes:
sideshowbarker
2024-07-19 07:20:50 +09:00
Author: https://github.com/linusg
Commit: 95b51e857d
Pull-request: https://github.com/SerenityOS/serenity/pull/1938
6 changed files with 13 additions and 3 deletions
|
@ -1037,6 +1037,7 @@ bool Parser::match_expression() const
|
|||
return type == TokenType::BoolLiteral
|
||||
|| type == TokenType::NumericLiteral
|
||||
|| type == TokenType::StringLiteral
|
||||
|| type == TokenType::TemplateLiteral
|
||||
|| type == TokenType::NullLiteral
|
||||
|| type == TokenType::Identifier
|
||||
|| type == TokenType::New
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue