summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Parser.h
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-06-03 16:05:49 -0700
committerAndreas Kling <kling@serenityos.org>2020-06-07 19:06:55 +0200
commit61ac1d3ffa1adb3df7d8787d78eab2399352a942 (patch)
treeffa909a56037203cee3f7b788bb41835df1c3964 /Libraries/LibJS/Parser.h
parent984a6ff97b3cceca94d0b8c502ef072e7e35dfb0 (diff)
downloadserenity-61ac1d3ffa1adb3df7d8787d78eab2399352a942.zip
LibJS: Lex and parse regex literals, add RegExp objects
This adds regex parsing/lexing, as well as a relatively empty RegExpObject. The purpose of this patch is to allow the engine to not get hung up on parsing regexes. This will aid in finding new syntax errors (say, from google or twitter) without having to replace all of their regexes first!
Diffstat (limited to 'Libraries/LibJS/Parser.h')
-rw-r--r--Libraries/LibJS/Parser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibJS/Parser.h b/Libraries/LibJS/Parser.h
index 4d36d85f98..0b256d3f76 100644
--- a/Libraries/LibJS/Parser.h
+++ b/Libraries/LibJS/Parser.h
@@ -70,6 +70,7 @@ public:
NonnullRefPtr<Expression> parse_expression(int min_precedence, Associativity associate = Associativity::Right, Vector<TokenType> forbidden = {});
NonnullRefPtr<Expression> parse_primary_expression();
NonnullRefPtr<Expression> parse_unary_prefixed_expression();
+ NonnullRefPtr<RegExpLiteral> parse_regexp_literal();
NonnullRefPtr<ObjectExpression> parse_object_expression();
NonnullRefPtr<ArrayExpression> parse_array_expression();
NonnullRefPtr<StringLiteral> parse_string_literal(Token token);