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

Side by Side 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: Implement handling of arrow functions in the parser Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 token = Select('=', Token::ASSIGN_SHR, Token::SHR); 410 token = Select('=', Token::ASSIGN_SHR, Token::SHR);
411 } else { 411 } else {
412 token = Token::SAR; 412 token = Token::SAR;
413 } 413 }
414 } else { 414 } else {
415 token = Token::GT; 415 token = Token::GT;
416 } 416 }
417 break; 417 break;
418 418
419 case '=': 419 case '=':
420 // = == === 420 // = == === =>
421 Advance(); 421 Advance();
422 if (c0_ == '=') { 422 if (c0_ == '=') {
423 token = Select('=', Token::EQ_STRICT, Token::EQ); 423 token = Select('=', Token::EQ_STRICT, Token::EQ);
424 } else if (c0_ == '>') {
425 token = Select(Token::ARROW);
424 } else { 426 } else {
425 token = Token::ASSIGN; 427 token = Token::ASSIGN;
426 } 428 }
427 break; 429 break;
428 430
429 case '!': 431 case '!':
430 // ! != !== 432 // ! != !==
431 Advance(); 433 Advance();
432 if (c0_ == '=') { 434 if (c0_ == '=') {
433 token = Select('=', Token::NE_STRICT, Token::NE); 435 token = Select('=', Token::NE_STRICT, Token::NE);
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 } 1304 }
1303 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); 1305 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u));
1304 } 1306 }
1305 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); 1307 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f));
1306 1308
1307 backing_store_.AddBlock(bytes); 1309 backing_store_.AddBlock(bytes);
1308 return backing_store_.EndSequence().start(); 1310 return backing_store_.EndSequence().start();
1309 } 1311 }
1310 1312
1311 } } // namespace v8::internal 1313 } } // namespace v8::internal
OLDNEW
« src/preparser.cc ('K') | « src/runtime.cc ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698