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

Side by Side Diff: src/parser.cc

Issue 905003003: Rename ParseSourceElements in preparser too (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove kUnknownSourceElements Created 5 years, 10 months 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
« no previous file with comments | « no previous file | src/preparser.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 Expect(Token::RBRACE, CHECK_OK); 2070 Expect(Token::RBRACE, CHECK_OK);
2071 return result; 2071 return result;
2072 } 2072 }
2073 2073
2074 2074
2075 Block* Parser::ParseScopedBlock(ZoneList<const AstRawString*>* labels, 2075 Block* Parser::ParseScopedBlock(ZoneList<const AstRawString*>* labels,
2076 bool* ok) { 2076 bool* ok) {
2077 // The harmony mode uses block elements instead of statements. 2077 // The harmony mode uses block elements instead of statements.
2078 // 2078 //
2079 // Block :: 2079 // Block ::
2080 // '{' BlockElement* '}' 2080 // '{' StatementList '}'
2081 2081
2082 // Construct block expecting 16 statements. 2082 // Construct block expecting 16 statements.
2083 Block* body = 2083 Block* body =
2084 factory()->NewBlock(labels, 16, false, RelocInfo::kNoPosition); 2084 factory()->NewBlock(labels, 16, false, RelocInfo::kNoPosition);
2085 Scope* block_scope = NewScope(scope_, BLOCK_SCOPE); 2085 Scope* block_scope = NewScope(scope_, BLOCK_SCOPE);
2086 2086
2087 // Parse the statements and collect escaping labels. 2087 // Parse the statements and collect escaping labels.
2088 Expect(Token::LBRACE, CHECK_OK); 2088 Expect(Token::LBRACE, CHECK_OK);
2089 block_scope->set_start_position(scanner()->location().beg_pos); 2089 block_scope->set_start_position(scanner()->location().beg_pos);
2090 { BlockState block_state(&scope_, block_scope); 2090 { BlockState block_state(&scope_, block_scope);
(...skipping 3343 matching lines...) Expand 10 before | Expand all | Expand 10 after
5434 } else { 5434 } else {
5435 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); 5435 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data());
5436 running_hash = StringHasher::ComputeRunningHash(running_hash, data, 5436 running_hash = StringHasher::ComputeRunningHash(running_hash, data,
5437 raw_string->length()); 5437 raw_string->length());
5438 } 5438 }
5439 } 5439 }
5440 5440
5441 return running_hash; 5441 return running_hash;
5442 } 5442 }
5443 } } // namespace v8::internal 5443 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698