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

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: rebase over generator change cl Created 4 years, 8 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/parsing/scanner.cc
diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc
index 698cb5e9058b66df6228257768b69db5ff33268c..f722e93b7fe0c74f794307a28a097116ad4b0826 100644
--- a/src/parsing/scanner.cc
+++ b/src/parsing/scanner.cc
@@ -249,6 +249,8 @@ 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_before_next2_;
+ has_multiline_comment_before_next_ = has_multiline_comment_before_next2_;
return current_.token;
}
has_line_terminator_before_next_ = false;
@@ -274,7 +276,13 @@ Token::Value Scanner::PeekAhead() {
return next_next_.token;
}
TokenDesc prev = current_;
+ bool has_line_terminator_before_next = has_line_terminator_before_next_;
+ bool has_multiline_comment_before_next = has_multiline_comment_before_next_;
Next();
+ has_line_terminator_before_next2_ = has_line_terminator_before_next_;
+ has_multiline_comment_before_next2_ = has_multiline_comment_before_next_;
+ has_line_terminator_before_next_ = has_line_terminator_before_next;
+ has_multiline_comment_before_next_ = has_multiline_comment_before_next;
Token::Value ret = next_.token;
next_next_ = next_;
next_ = current_;
@@ -1468,6 +1476,15 @@ const AstRawString* Scanner::NextSymbol(AstValueFactory* ast_value_factory) {
return ast_value_factory->GetTwoByteString(next_literal_two_byte_string());
}
+const AstRawString* Scanner::NextNextSymbol(
+ AstValueFactory* ast_value_factory) {
+ DCHECK(next_next_.token != Token::UNINITIALIZED);
+ LiteralBuffer* literal = next_next_.literal_chars;
+ if (literal->is_one_byte()) {
+ return ast_value_factory->GetOneByteString(literal->one_byte_literal());
+ }
+ return ast_value_factory->GetTwoByteString(literal->two_byte_literal());
+}
const AstRawString* Scanner::CurrentRawSymbol(
AstValueFactory* ast_value_factory) {
« src/parsing/parser.cc ('K') | « src/parsing/scanner.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698