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

Unified Diff: src/parsing/scanner.h

Issue 1841543003: [esnext] implement frontend changes for async/await proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase for dependent CLs 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
Index: src/parsing/scanner.h
diff --git a/src/parsing/scanner.h b/src/parsing/scanner.h
index b4c6b62d1488f5654869ca4e9bfedd2c03f79f1f..9a3dd8a02a28039bea1c10a22474cce01ce01315 100644
--- a/src/parsing/scanner.h
+++ b/src/parsing/scanner.h
@@ -371,6 +371,10 @@ class Scanner {
Token::Value peek() const { return next_.token; }
Location peek_location() const { return next_.location; }
+ Location peek_ahead_location() const {
+ DCHECK(next_next_.token != Token::UNINITIALIZED);
+ return next_next_.location;
+ }
bool literal_contains_escapes() const {
return LiteralContainsEscapes(current_);
@@ -387,8 +391,14 @@ class Scanner {
return next_.literal_chars->is_contextual_keyword(keyword);
}
+ bool is_next_next_contextual_keyword(Vector<const char> keyword) {
+ DCHECK_NOT_NULL(next_next_.literal_chars);
+ return next_next_.literal_chars->is_contextual_keyword(keyword);
+ }
+
const AstRawString* CurrentSymbol(AstValueFactory* ast_value_factory);
const AstRawString* NextSymbol(AstValueFactory* ast_value_factory);
+ const AstRawString* NextNextSymbol(AstValueFactory* ast_value_factory);
const AstRawString* CurrentRawSymbol(AstValueFactory* ast_value_factory);
double DoubleValue();
@@ -442,6 +452,13 @@ class Scanner {
has_multiline_comment_before_next_;
}
+ bool HasAnyLineTerminatorAfterNext() {
+ Token::Value ensure_next_next = PeekAhead();
+ USE(ensure_next_next);
+ return has_line_terminator_before_next2_ ||
+ has_multiline_comment_before_next2_;
+ }
+
// Scans the input as a regular expression pattern, previous
// character(s) must be /(=). Returns true if a pattern is scanned.
bool ScanRegExpPattern(bool seen_equal);
@@ -787,6 +804,10 @@ class Scanner {
// line-terminator after the current token, and before the next.
bool has_multiline_comment_before_next_;
+ // For use with PeekAhead()
+ bool has_line_terminator_before_next2_;
+ bool has_multiline_comment_before_next2_;
+
// Whether this scanner encountered an HTML comment.
bool found_html_comment_;

Powered by Google App Engine
This is Rietveld 408576698