1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:15:09 +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

@ -89,6 +89,8 @@ NonnullOwnPtr<Expression> Parser::parse_primary_expression()
return make<NumericLiteral>(consume().double_value());
case TokenType::BoolLiteral:
return make<BooleanLiteral>(consume().bool_value());
case TokenType::StringLiteral:
return make<StringLiteral>(consume().string_value());
case TokenType::CurlyOpen:
return parse_object_expression();
default: