1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibJS: Parse and partially execute import and export statements

We produce the import and export entries as per the spec. However we do
not yet verify that named things that are exported are declared
somewhere.
This commit is contained in:
davidot 2021-08-14 17:42:30 +02:00 committed by Linus Groh
parent 7613c22b06
commit 020bfc9d93
4 changed files with 489 additions and 0 deletions

View file

@ -87,6 +87,8 @@ public:
NonnullRefPtr<Expression> parse_property_key();
NonnullRefPtr<AssignmentExpression> parse_assignment_expression(AssignmentOp, NonnullRefPtr<Expression> lhs, int min_precedence, Associativity);
NonnullRefPtr<Identifier> parse_identifier();
NonnullRefPtr<ImportStatement> parse_import_statement(Program& program);
NonnullRefPtr<ExportStatement> parse_export_statement(Program& program);
RefPtr<FunctionExpression> try_parse_arrow_function_expression(bool expect_parens);
RefPtr<Statement> try_parse_labelled_statement();
@ -150,6 +152,7 @@ private:
bool match_unary_prefixed_expression() const;
bool match_secondary_expression(const Vector<TokenType>& forbidden = {}) const;
bool match_statement() const;
bool match_export_or_import() const;
bool match_declaration() const;
bool match_variable_declaration() const;
bool match_identifier() const;