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

Unified Diff: src/scanner-base.h

Issue 7218009: Make multi-line comments not count when checking whether --> is first on a line. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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/scanner.cc ('k') | src/scanner-base.cc » ('j') | src/scanner-base.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-base.h
diff --git a/src/scanner-base.h b/src/scanner-base.h
index 02566ddebb6014a629c10b0095b8aa5984a82273..1368cb6a66610a040bffa480f6696a72cc1ec7e5 100644
--- a/src/scanner-base.h
+++ b/src/scanner-base.h
@@ -479,6 +479,12 @@ class JavaScriptScanner : public Scanner {
return has_line_terminator_before_next_;
}
+ // Returns true if there was no non-whitespace on the line before the
+ // peek'ed token.
+ bool next_is_first_on_line() const {
+ return next_is_first_on_line_;
+ }
+
// 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);
@@ -529,7 +535,12 @@ class JavaScriptScanner : public Scanner {
// Start position of the octal literal last scanned.
Location octal_pos_;
+ // Whether there is a line terminator between the current proper
+ // token and the next one (ignoring whitespace tokens and comments).
bool has_line_terminator_before_next_;
+ // Whether there is only whitespace (and not comments) on the current
+ // line until now.
+ bool next_is_first_on_line_;
};
« no previous file with comments | « src/scanner.cc ('k') | src/scanner-base.cc » ('j') | src/scanner-base.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698