mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:37:35 +00:00
LibJS: Force the lexer to parse a regex when expecting a statement
This commit is contained in:
parent
05444103e3
commit
106f9e30d7
4 changed files with 103 additions and 21 deletions
|
@ -25,6 +25,8 @@ public:
|
|||
|
||||
void disallow_html_comments() { m_allow_html_comments = false; };
|
||||
|
||||
Token force_slash_as_regex();
|
||||
|
||||
private:
|
||||
void consume();
|
||||
bool consume_exponent();
|
||||
|
@ -47,6 +49,8 @@ private:
|
|||
bool match_numeric_literal_separator_followed_by(Callback) const;
|
||||
bool slash_means_division() const;
|
||||
|
||||
TokenType consume_regex_literal();
|
||||
|
||||
StringView m_source;
|
||||
size_t m_position { 0 };
|
||||
Token m_current_token;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue