| 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |