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

Unified Diff: src/scanner.cc

Issue 160073006: Implement handling of arrow functions in the parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Extra parens in parameter lists now recognized, no longer segfaults on "()" Created 6 years, 7 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.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index 2e039ca40353ee695e28b465ebdf3e7006aee5a8..05e24cacb7f435e49f9820ff203b7b204fd30be4 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -209,6 +209,7 @@ Token::Value Scanner::Next() {
current_ = next_;
has_line_terminator_before_next_ = false;
has_multiline_comment_before_next_ = false;
+ param_list_finder_.Update(current_.token, current_.location.beg_pos);
if (static_cast<unsigned>(c0_) <= 0x7f) {
Token::Value token = static_cast<Token::Value>(one_char_tokens[c0_]);
if (token != Token::ILLEGAL) {
@@ -394,10 +395,12 @@ void Scanner::Scan() {
break;
case '=':
- // = == ===
+ // = == === =>
Advance();
if (c0_ == '=') {
token = Select('=', Token::EQ_STRICT, Token::EQ);
+ } else if (c0_ == '>') {
+ token = Select(Token::ARROW);
} else {
token = Token::ASSIGN;
}

Powered by Google App Engine
This is Rietveld 408576698