OLD | NEW |
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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 PreParser::Statement PreParser::ParseDoWhileStatement(bool* ok) { | 620 PreParser::Statement PreParser::ParseDoWhileStatement(bool* ok) { |
621 // DoStatement :: | 621 // DoStatement :: |
622 // 'do' Statement 'while' '(' Expression ')' ';' | 622 // 'do' Statement 'while' '(' Expression ')' ';' |
623 | 623 |
624 Expect(i::Token::DO, CHECK_OK); | 624 Expect(i::Token::DO, CHECK_OK); |
625 ParseStatement(CHECK_OK); | 625 ParseStatement(CHECK_OK); |
626 Expect(i::Token::WHILE, CHECK_OK); | 626 Expect(i::Token::WHILE, CHECK_OK); |
627 Expect(i::Token::LPAREN, CHECK_OK); | 627 Expect(i::Token::LPAREN, CHECK_OK); |
628 ParseExpression(true, CHECK_OK); | 628 ParseExpression(true, CHECK_OK); |
629 Expect(i::Token::RPAREN, ok); | 629 Expect(i::Token::RPAREN, ok); |
| 630 if (peek() == i::Token::SEMICOLON) Consume(i::Token::SEMICOLON); |
630 return Statement::Default(); | 631 return Statement::Default(); |
631 } | 632 } |
632 | 633 |
633 | 634 |
634 PreParser::Statement PreParser::ParseWhileStatement(bool* ok) { | 635 PreParser::Statement PreParser::ParseWhileStatement(bool* ok) { |
635 // WhileStatement :: | 636 // WhileStatement :: |
636 // 'while' '(' Expression ')' Statement | 637 // 'while' '(' Expression ')' Statement |
637 | 638 |
638 Expect(i::Token::WHILE, CHECK_OK); | 639 Expect(i::Token::WHILE, CHECK_OK); |
639 Expect(i::Token::LPAREN, CHECK_OK); | 640 Expect(i::Token::LPAREN, CHECK_OK); |
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u)); | 1779 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u)); |
1779 } | 1780 } |
1780 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u)); | 1781 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u)); |
1781 } | 1782 } |
1782 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f)); | 1783 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f)); |
1783 | 1784 |
1784 backing_store_.AddBlock(bytes); | 1785 backing_store_.AddBlock(bytes); |
1785 return backing_store_.EndSequence().start(); | 1786 return backing_store_.EndSequence().start(); |
1786 } | 1787 } |
1787 } } // v8::preparser | 1788 } } // v8::preparser |
OLD | NEW |