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

Unified Diff: src/scanner.h

Issue 316173002: Handle "//# sourceURL" comments in the Parser instead of the JS. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: oops Created 6 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
Index: src/scanner.h
diff --git a/src/scanner.h b/src/scanner.h
index 2979082e3f152623527df8a69a4b2d177f592323..5e2e065b3f97c4c702759cb57da996c8ce4abd08 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -450,6 +450,9 @@ class Scanner {
// be empty).
bool ScanRegExpFlags();
+ bool HasSourceMapComment() { return has_source_map_comment_; }
+ Handle<String> AllocateInternalizedSourceMapComment(Isolate* isolate);
+
private:
// The current and look-ahead token.
struct TokenDesc {
@@ -571,6 +574,7 @@ class Scanner {
bool SkipWhiteSpace();
Token::Value SkipSingleLineComment();
+ Token::Value SkipSourceMapComment();
Token::Value SkipMultiLineComment();
// Scans a possible HTML comment -- begins with '<!'.
Token::Value ScanHtmlComment();
@@ -605,6 +609,8 @@ class Scanner {
LiteralBuffer literal_buffer1_;
LiteralBuffer literal_buffer2_;
+ LiteralBuffer source_map_comment_;
+
TokenDesc current_; // desc for current token (as returned by Next())
TokenDesc next_; // desc for next token (one token look-ahead)
@@ -625,6 +631,8 @@ class Scanner {
// Whether there is a multi-line comment that contains a
// line-terminator after the current token, and before the next.
bool has_multiline_comment_before_next_;
+ // Whether the last line we have scanned is a source map comment.
+ bool has_source_map_comment_;
// Whether we scan 'let' as a keyword for harmony block-scoped let bindings.
bool harmony_scoping_;
// Whether we scan 'module', 'import', 'export' as keywords.

Powered by Google App Engine
This is Rietveld 408576698