diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-12 13:05:06 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-12 13:05:06 +0100 |
commit | ed100bc6f4818568d510c5b91d21259ac03e5015 (patch) | |
tree | 5703737c32dff2a2656f5e0df8ffa2b47b5e21b6 /Libraries/LibJS/Parser.cpp | |
parent | 879bf3e97b5d36b83e39eef66c8b54874b8199ab (diff) | |
download | serenity-ed100bc6f4818568d510c5b91d21259ac03e5015.zip |
LibJS: Implement basic lexing + parsing of StringLiteral
This still includes the double-quote characters (") but at least the
AST comes out right.
Diffstat (limited to 'Libraries/LibJS/Parser.cpp')
-rw-r--r-- | Libraries/LibJS/Parser.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibJS/Parser.cpp b/Libraries/LibJS/Parser.cpp index 1cfc3be231..b9467cebd3 100644 --- a/Libraries/LibJS/Parser.cpp +++ b/Libraries/LibJS/Parser.cpp @@ -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: |