1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +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:
Andreas Kling 2020-03-12 13:05:06 +01:00
parent 879bf3e97b
commit ed100bc6f4
2 changed files with 9 additions and 0 deletions

View file

@ -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 {