Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1163)

Unified Diff: src/parser.h

Issue 788043005: ES6 unicode escapes, part 2: Regexps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mirror regexp test Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 219f1c4b211a591ab807ce33d303e9602dafa72e..518b443e3d4e9b95d587d3d17b9f8aa964d81113 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -222,15 +222,11 @@ class RegExpBuilder: public ZoneObject {
class RegExpParser BASE_EMBEDDED {
public:
- RegExpParser(FlatStringReader* in,
- Handle<String>* error,
- bool multiline_mode,
- Zone* zone);
+ RegExpParser(FlatStringReader* in, Handle<String>* error, bool multiline_mode,
+ bool unicode, Zone* zone);
- static bool ParseRegExp(FlatStringReader* input,
- bool multiline,
- RegExpCompileData* result,
- Zone* zone);
+ static bool ParseRegExp(FlatStringReader* input, bool multiline, bool unicode,
+ RegExpCompileData* result, Zone* zone);
RegExpTree* ParsePattern();
RegExpTree* ParseDisjunction();
@@ -248,6 +244,8 @@ class RegExpParser BASE_EMBEDDED {
// Checks whether the following is a length-digit hexadecimal number,
// and sets the value if it is.
bool ParseHexEscape(int length, uc32* value);
+ bool ParseUnicodeEscape(uc32* value);
+ bool ParseUnlimitedLengthHexNumber(int max_value, uc32* value);
uc32 ParseOctalLiteral();
@@ -272,6 +270,8 @@ class RegExpParser BASE_EMBEDDED {
int position() { return next_pos_ - 1; }
bool failed() { return failed_; }
+ static bool IsSyntaxCharacter(uc32 c);
+
static const int kMaxCaptures = 1 << 16;
static const uc32 kEndMarker = (1 << 21);
@@ -338,6 +338,7 @@ class RegExpParser BASE_EMBEDDED {
int capture_count_;
bool has_more_;
bool multiline_;
+ bool unicode_;
bool simple_;
bool contains_anchor_;
bool is_scanned_for_captures_;
« no previous file with comments | « src/objects.h ('k') | src/parser.cc » ('j') | test/mjsunit/harmony/unicode-escapes-in-regexps.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698