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

Side by Side Diff: src/preparser.cc

Issue 8847007: Merge r10201 to 3.6 branch: Sync parser and preparser on do-while and return statements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.6
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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 PreParser::Statement PreParser::ParseDoWhileStatement(bool* ok) { 533 PreParser::Statement PreParser::ParseDoWhileStatement(bool* ok) {
534 // DoStatement :: 534 // DoStatement ::
535 // 'do' Statement 'while' '(' Expression ')' ';' 535 // 'do' Statement 'while' '(' Expression ')' ';'
536 536
537 Expect(i::Token::DO, CHECK_OK); 537 Expect(i::Token::DO, CHECK_OK);
538 ParseStatement(CHECK_OK); 538 ParseStatement(CHECK_OK);
539 Expect(i::Token::WHILE, CHECK_OK); 539 Expect(i::Token::WHILE, CHECK_OK);
540 Expect(i::Token::LPAREN, CHECK_OK); 540 Expect(i::Token::LPAREN, CHECK_OK);
541 ParseExpression(true, CHECK_OK); 541 ParseExpression(true, CHECK_OK);
542 Expect(i::Token::RPAREN, ok); 542 Expect(i::Token::RPAREN, ok);
543 if (peek() == i::Token::SEMICOLON) Consume(i::Token::SEMICOLON);
543 return Statement::Default(); 544 return Statement::Default();
544 } 545 }
545 546
546 547
547 PreParser::Statement PreParser::ParseWhileStatement(bool* ok) { 548 PreParser::Statement PreParser::ParseWhileStatement(bool* ok) {
548 // WhileStatement :: 549 // WhileStatement ::
549 // 'while' '(' Expression ')' Statement 550 // 'while' '(' Expression ')' Statement
550 551
551 Expect(i::Token::WHILE, CHECK_OK); 552 Expect(i::Token::WHILE, CHECK_OK);
552 Expect(i::Token::LPAREN, CHECK_OK); 553 Expect(i::Token::LPAREN, CHECK_OK);
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u)); 1671 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u));
1671 } 1672 }
1672 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u)); 1673 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u));
1673 } 1674 }
1674 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f)); 1675 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f));
1675 1676
1676 backing_store_.AddBlock(bytes); 1677 backing_store_.AddBlock(bytes);
1677 return backing_store_.EndSequence().start(); 1678 return backing_store_.EndSequence().start();
1678 } 1679 }
1679 } } // v8::preparser 1680 } } // 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