mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibJS: Implement basic lexing + parsing of StringLiteral
This still includes the double-quote characters (") but at least the
AST comes out right.
This commit is contained in:
@@ -195,6 +195,13 @@ Token Lexer::next()
|
||||
consume();
|
||||
}
|
||||
token_type = TokenType::NumericLiteral;
|
||||
} else if (m_current_char == '"') {
|
||||
consume();
|
||||
while (m_current_char != '"') {
|
||||
consume();
|
||||
}
|
||||
consume();
|
||||
token_type = TokenType::StringLiteral;
|
||||
} else if (m_current_char == EOF) {
|
||||
token_type = TokenType::Eof;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user