mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:18:13 +00:00
LibJS: Do not save state for peeking at the next token from the lexer
This saves having to save and load the parser state. This could give an incorrect token in some cases where the parser communicates to the lexer. However this is not applicable in any of the current usages and this would require one to parse the current token as normal which is exactly what you don't want to do in that scenario.
This commit is contained in:
parent
c3cb44ca8a
commit
9394cbcd24
2 changed files with 12 additions and 17 deletions
|
@ -172,9 +172,9 @@ private:
|
|||
bool match_secondary_expression(const Vector<TokenType>& forbidden = {}) const;
|
||||
bool match_statement() const;
|
||||
bool match_export_or_import() const;
|
||||
bool match_declaration();
|
||||
bool try_match_let_declaration();
|
||||
bool match_variable_declaration();
|
||||
bool match_declaration() const;
|
||||
bool try_match_let_declaration() const;
|
||||
bool match_variable_declaration() const;
|
||||
bool match_identifier() const;
|
||||
bool match_identifier_name() const;
|
||||
bool match_property_key() const;
|
||||
|
@ -195,7 +195,7 @@ private:
|
|||
|
||||
RefPtr<BindingPattern> synthesize_binding_pattern(Expression const& expression);
|
||||
|
||||
Token next_token();
|
||||
Token next_token() const;
|
||||
|
||||
void check_identifier_name_for_assignment_validity(StringView, bool force_strict = false);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue