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

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 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.h
diff --git a/src/parsing/scanner.h b/src/parsing/scanner.h
index 22c504c98ea206b760d84ae76b8bb85b5ddfe81c..996eadac65aa8628c6cf52981cbc493c43d1b98b 100644
--- a/src/parsing/scanner.h
+++ b/src/parsing/scanner.h
@@ -365,6 +365,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_);
@@ -381,8 +385,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();
@@ -436,6 +446,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);
@@ -781,6 +798,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_;
« src/parsing/parser.cc ('K') | « src/parsing/preparser.cc ('k') | src/parsing/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698