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

Side by Side Diff: src/preparser.cc

Issue 8846004: Merge r10201 to 3.5 branch: Sync parser and preparser on do-while and return statements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.5
Patch Set: Created 9 years 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
« no previous file with comments | « src/parser.cc ('k') | src/version.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 PreParser::Statement PreParser::ParseDoWhileStatement(bool* ok) { 531 PreParser::Statement PreParser::ParseDoWhileStatement(bool* ok) {
532 // DoStatement :: 532 // DoStatement ::
533 // 'do' Statement 'while' '(' Expression ')' ';' 533 // 'do' Statement 'while' '(' Expression ')' ';'
534 534
535 Expect(i::Token::DO, CHECK_OK); 535 Expect(i::Token::DO, CHECK_OK);
536 ParseStatement(CHECK_OK); 536 ParseStatement(CHECK_OK);
537 Expect(i::Token::WHILE, CHECK_OK); 537 Expect(i::Token::WHILE, CHECK_OK);
538 Expect(i::Token::LPAREN, CHECK_OK); 538 Expect(i::Token::LPAREN, CHECK_OK);
539 ParseExpression(true, CHECK_OK); 539 ParseExpression(true, CHECK_OK);
540 Expect(i::Token::RPAREN, ok); 540 Expect(i::Token::RPAREN, ok);
541 if (peek() == i::Token::SEMICOLON) Consume(i::Token::SEMICOLON);
541 return Statement::Default(); 542 return Statement::Default();
542 } 543 }
543 544
544 545
545 PreParser::Statement PreParser::ParseWhileStatement(bool* ok) { 546 PreParser::Statement PreParser::ParseWhileStatement(bool* ok) {
546 // WhileStatement :: 547 // WhileStatement ::
547 // 'while' '(' Expression ')' Statement 548 // 'while' '(' Expression ')' Statement
548 549
549 Expect(i::Token::WHILE, CHECK_OK); 550 Expect(i::Token::WHILE, CHECK_OK);
550 Expect(i::Token::LPAREN, CHECK_OK); 551 Expect(i::Token::LPAREN, CHECK_OK);
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 return result; 1483 return result;
1483 } 1484 }
1484 1485
1485 bool PreParser::peek_any_identifier() { 1486 bool PreParser::peek_any_identifier() {
1486 i::Token::Value next = peek(); 1487 i::Token::Value next = peek();
1487 return next == i::Token::IDENTIFIER || 1488 return next == i::Token::IDENTIFIER ||
1488 next == i::Token::FUTURE_RESERVED_WORD || 1489 next == i::Token::FUTURE_RESERVED_WORD ||
1489 next == i::Token::FUTURE_STRICT_RESERVED_WORD; 1490 next == i::Token::FUTURE_STRICT_RESERVED_WORD;
1490 } 1491 }
1491 } } // v8::preparser 1492 } } // v8::preparser
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698