summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Lexer.h
diff options
context:
space:
mode:
authordavidot <david.tuin@gmail.com>2021-07-29 23:28:28 +0200
committerLinus Groh <mail@linusgroh.de>2021-08-16 23:20:04 +0100
commit106f9e30d706eb95775c08b3bd37a1edfd17c557 (patch)
tree78ba5f592072d73fd8fea714a673bf98552ac222 /Userland/Libraries/LibJS/Lexer.h
parent05444103e391bff9efb35be2c0e218fdbb9ab67e (diff)
downloadserenity-106f9e30d706eb95775c08b3bd37a1edfd17c557.zip
LibJS: Force the lexer to parse a regex when expecting a statement
Diffstat (limited to 'Userland/Libraries/LibJS/Lexer.h')
-rw-r--r--Userland/Libraries/LibJS/Lexer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Lexer.h b/Userland/Libraries/LibJS/Lexer.h
index b301e5aebd..3117ee15a5 100644
--- a/Userland/Libraries/LibJS/Lexer.h
+++ b/Userland/Libraries/LibJS/Lexer.h
@@ -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;