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

Unified Diff: src/parsing/scanner.cc

Issue 1841543003: [esnext] implement frontend changes for async/await proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Uncomment that test Created 4 years, 7 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
« no previous file with comments | « src/parsing/scanner.h ('k') | src/parsing/token.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/scanner.cc
diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc
index faec88b8a4bfb5ff37bf8dad58fefc32cd8ff03f..a56989f0a4bba90d70eec78d6f2bda93c35967ce 100644
--- a/src/parsing/scanner.cc
+++ b/src/parsing/scanner.cc
@@ -249,6 +249,7 @@ Token::Value Scanner::Next() {
if (V8_UNLIKELY(next_next_.token != Token::UNINITIALIZED)) {
next_ = next_next_;
next_next_.token = Token::UNINITIALIZED;
+ has_line_terminator_before_next_ = has_line_terminator_after_next_;
return current_.token;
}
has_line_terminator_before_next_ = false;
@@ -274,7 +275,12 @@ Token::Value Scanner::PeekAhead() {
return next_next_.token;
}
TokenDesc prev = current_;
+ bool has_line_terminator_before_next =
+ has_line_terminator_before_next_ || has_multiline_comment_before_next_;
Next();
+ has_line_terminator_after_next_ =
+ has_line_terminator_before_next_ || has_multiline_comment_before_next_;
+ has_line_terminator_before_next_ = has_line_terminator_before_next;
Token::Value ret = next_.token;
next_next_ = next_;
next_ = current_;
@@ -1136,6 +1142,7 @@ uc32 Scanner::ScanUnicodeEscape() {
#define KEYWORDS(KEYWORD_GROUP, KEYWORD) \
KEYWORD_GROUP('a') \
+ KEYWORD("async", Token::ASYNC) \
KEYWORD("await", Token::AWAIT) \
KEYWORD_GROUP('b') \
KEYWORD("break", Token::BREAK) \
« no previous file with comments | « src/parsing/scanner.h ('k') | src/parsing/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698