OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2564 Expect(Token::RPAREN, CHECK_OK); | 2564 Expect(Token::RPAREN, CHECK_OK); |
2565 | 2565 |
2566 top_scope_->DeclarationScope()->RecordWithStatement(); | 2566 top_scope_->DeclarationScope()->RecordWithStatement(); |
2567 Scope* with_scope = NewScope(top_scope_, WITH_SCOPE); | 2567 Scope* with_scope = NewScope(top_scope_, WITH_SCOPE); |
2568 Statement* stmt; | 2568 Statement* stmt; |
2569 { BlockState block_state(this, with_scope); | 2569 { BlockState block_state(this, with_scope); |
2570 with_scope->set_start_position(scanner().peek_location().beg_pos); | 2570 with_scope->set_start_position(scanner().peek_location().beg_pos); |
2571 stmt = ParseStatement(labels, CHECK_OK); | 2571 stmt = ParseStatement(labels, CHECK_OK); |
2572 with_scope->set_end_position(scanner().location().end_pos); | 2572 with_scope->set_end_position(scanner().location().end_pos); |
2573 } | 2573 } |
2574 return factory()->NewWithStatement(expr, stmt); | 2574 return factory()->NewWithStatement(with_scope, expr, stmt); |
2575 } | 2575 } |
2576 | 2576 |
2577 | 2577 |
2578 CaseClause* Parser::ParseCaseClause(bool* default_seen_ptr, bool* ok) { | 2578 CaseClause* Parser::ParseCaseClause(bool* default_seen_ptr, bool* ok) { |
2579 // CaseClause :: | 2579 // CaseClause :: |
2580 // 'case' Expression ':' Statement* | 2580 // 'case' Expression ':' Statement* |
2581 // 'default' ':' Statement* | 2581 // 'default' ':' Statement* |
2582 | 2582 |
2583 Expression* label = NULL; // NULL expression indicates default case | 2583 Expression* label = NULL; // NULL expression indicates default case |
2584 if (peek() == Token::CASE) { | 2584 if (peek() == Token::CASE) { |
(...skipping 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6036 ASSERT(info()->isolate()->has_pending_exception()); | 6036 ASSERT(info()->isolate()->has_pending_exception()); |
6037 } else { | 6037 } else { |
6038 result = ParseProgram(); | 6038 result = ParseProgram(); |
6039 } | 6039 } |
6040 } | 6040 } |
6041 info()->SetFunction(result); | 6041 info()->SetFunction(result); |
6042 return (result != NULL); | 6042 return (result != NULL); |
6043 } | 6043 } |
6044 | 6044 |
6045 } } // namespace v8::internal | 6045 } } // namespace v8::internal |
OLD | NEW |