Chromium Code Reviews| Index: src/scanner-base.h |
| diff --git a/src/scanner-base.h b/src/scanner-base.h |
| index 02566ddebb6014a629c10b0095b8aa5984a82273..0011afba398b10edf6e86d3f7dd35111f13a1ba2 100644 |
| --- a/src/scanner-base.h |
| +++ b/src/scanner-base.h |
| @@ -474,9 +474,13 @@ class JavaScriptScanner : public Scanner { |
| // Returns the next token. |
| Token::Value Next(); |
| - // Returns true if there was a line terminator before the peek'ed token. |
| + // Returns true if there was a line terminator before the peek'ed token, |
| + // possibly inside a multi-line comment. |
| bool has_line_terminator_before_next() const { |
|
William Hesse
2011/06/21 12:38:54
You can't have a getter which does not get the act
Lasse Reichstein
2011/06/21 13:05:37
That would be using parser-level terminology in th
|
| - return has_line_terminator_before_next_; |
| + // The distinction between newlines as whitespace and newlines inside |
| + // multi-line comments only matter inside the scanner. |
|
William Hesse
2011/06/21 12:38:54
I don't think this sentence makes sense or adds an
Lasse Reichstein
2011/06/21 13:05:37
Again, semicolon-insertion is a parser-level conce
|
| + return has_line_terminator_before_next_ || |
| + has_multiline_comment_before_next_; |
| } |
| // Scans the input as a regular expression pattern, previous |
| @@ -529,7 +533,13 @@ class JavaScriptScanner : public Scanner { |
| // Start position of the octal literal last scanned. |
| Location octal_pos_; |
| + // Whether there is a line terminator whitespace character after |
| + // the current token, and before the next. Does not count newlines |
| + // inside multiline comments. |
| bool has_line_terminator_before_next_; |
| + // Whether there is a multi-line comment (actually containing a |
|
William Hesse
2011/06/21 12:38:54
... comment that actually contains a newline ...
Lasse Reichstein
2011/06/21 13:05:37
Done.
|
| + // line-terminator) after the current token, and before the next. |
| + bool has_multiline_comment_before_next_; |
| }; |