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

Unified Diff: src/scanner.h

Issue 716423002: ES6 unicode extensions, part 1. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add tests Created 6 years 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
« no previous file with comments | « src/preparser.h ('k') | src/scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.h
diff --git a/src/scanner.h b/src/scanner.h
index 46e6d32212a19e822a9ad18ab4eae35b9be90bb1..446355fce1207748da96eeddb7e68a06d3d594ca 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -460,6 +460,8 @@ class Scanner {
}
bool HarmonyTemplates() const { return harmony_templates_; }
void SetHarmonyTemplates(bool templates) { harmony_templates_ = templates; }
+ bool HarmonyUnicode() const { return harmony_unicode_; }
+ void SetHarmonyUnicode(bool unicode) { harmony_unicode_ = unicode; }
// Returns true if there was a line terminator before the peek'ed token,
// possibly inside a multi-line comment.
@@ -616,6 +618,10 @@ class Scanner {
}
uc32 ScanHexNumber(int expected_length);
+ // Scan a number of any length but not bigger than max_value. For example, the
+ // number can be 000000001, so it's very long in characters but its value is
+ // small.
+ uc32 ScanUnlimitedLengthHexNumber(int max_value);
// Scans a single JavaScript token.
void Scan();
@@ -642,6 +648,8 @@ class Scanner {
// Decodes a Unicode escape-sequence which is part of an identifier.
// If the escape sequence cannot be decoded the result is kBadChar.
uc32 ScanIdentifierUnicodeEscape();
+ // Helper for the above functions.
+ uc32 ScanUnicodeEscape();
// Return the current source position.
int source_pos() {
@@ -688,6 +696,8 @@ class Scanner {
bool harmony_classes_;
// Whether we scan TEMPLATE_SPAN and TEMPLATE_TAIL
bool harmony_templates_;
+ // Whether we allow \u{xxxxx}.
+ bool harmony_unicode_;
};
} } // namespace v8::internal
« no previous file with comments | « src/preparser.h ('k') | src/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698