From 61ac1d3ffa1adb3df7d8787d78eab2399352a942 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Wed, 3 Jun 2020 16:05:49 -0700 Subject: 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! --- Libraries/LibJS/Token.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Libraries/LibJS/Token.h') diff --git a/Libraries/LibJS/Token.h b/Libraries/LibJS/Token.h index 884a249f27..e12747df0b 100644 --- a/Libraries/LibJS/Token.h +++ b/Libraries/LibJS/Token.h @@ -113,6 +113,7 @@ namespace JS { __ENUMERATE_JS_TOKEN(QuestionMark) \ __ENUMERATE_JS_TOKEN(QuestionMarkPeriod) \ __ENUMERATE_JS_TOKEN(RegexLiteral) \ + __ENUMERATE_JS_TOKEN(RegexFlags) \ __ENUMERATE_JS_TOKEN(Return) \ __ENUMERATE_JS_TOKEN(Semicolon) \ __ENUMERATE_JS_TOKEN(ShiftLeft) \ @@ -138,6 +139,7 @@ namespace JS { __ENUMERATE_JS_TOKEN(Typeof) \ __ENUMERATE_JS_TOKEN(UnsignedShiftRight) \ __ENUMERATE_JS_TOKEN(UnsignedShiftRightEquals) \ + __ENUMERATE_JS_TOKEN(UnterminatedRegexLiteral) \ __ENUMERATE_JS_TOKEN(UnterminatedStringLiteral) \ __ENUMERATE_JS_TOKEN(UnterminatedTemplateLiteral) \ __ENUMERATE_JS_TOKEN(Var) \ -- cgit v1.2.3