Chromium Code Reviews| Index: src/parsing/scanner.cc |
| diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc |
| index faec88b8a4bfb5ff37bf8dad58fefc32cd8ff03f..84635d779171e46890cc8ad267745acf9f457d66 100644 |
| --- a/src/parsing/scanner.cc |
| +++ b/src/parsing/scanner.cc |
| @@ -249,6 +249,8 @@ Token::Value Scanner::Next() { |
| if (V8_UNLIKELY(next_next_.token != Token::UNINITIALIZED)) { |
| next_ = next_next_; |
| next_next_.token = Token::UNINITIALIZED; |
| + has_line_terminator_before_next_ = has_line_terminator_before_next2_; |
| + has_multiline_comment_before_next_ = has_multiline_comment_before_next2_; |
| return current_.token; |
| } |
| has_line_terminator_before_next_ = false; |
| @@ -274,7 +276,13 @@ Token::Value Scanner::PeekAhead() { |
| return next_next_.token; |
| } |
| TokenDesc prev = current_; |
| + bool has_line_terminator_before_next = has_line_terminator_before_next_; |
| + bool has_multiline_comment_before_next = has_multiline_comment_before_next_; |
| Next(); |
| + has_line_terminator_before_next2_ = has_line_terminator_before_next_; |
| + has_multiline_comment_before_next2_ = has_multiline_comment_before_next_; |
| + has_line_terminator_before_next_ = has_line_terminator_before_next; |
| + has_multiline_comment_before_next_ = has_multiline_comment_before_next; |
|
Dan Ehrenberg
2016/05/05 01:14:40
From my experience with let, I'd predict that main
caitp (gmail)
2016/05/05 01:36:57
Well, I've done this in the simplest way I could,
caitp (gmail)
2016/05/05 21:49:36
I've had a go at refactoring this --- I doubt it h
|
| Token::Value ret = next_.token; |
| next_next_ = next_; |
| next_ = current_; |
| @@ -1469,6 +1477,15 @@ const AstRawString* Scanner::NextSymbol(AstValueFactory* ast_value_factory) { |
| return ast_value_factory->GetTwoByteString(next_literal_two_byte_string()); |
| } |
| +const AstRawString* Scanner::NextNextSymbol( |
| + AstValueFactory* ast_value_factory) { |
| + DCHECK(next_next_.token != Token::UNINITIALIZED); |
| + LiteralBuffer* literal = next_next_.literal_chars; |
| + if (literal->is_one_byte()) { |
| + return ast_value_factory->GetOneByteString(literal->one_byte_literal()); |
| + } |
| + return ast_value_factory->GetTwoByteString(literal->two_byte_literal()); |
| +} |
| const AstRawString* Scanner::CurrentRawSymbol( |
| AstValueFactory* ast_value_factory) { |