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

Side by Side Diff: src/parser.cc

Issue 952343002: Rename ParseModule to ParseModuleItemList (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 9 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 | « src/parser.h ('k') | no next file » | 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 AstNodeFactory function_factory(ast_value_factory()); 935 AstNodeFactory function_factory(ast_value_factory());
936 FunctionState function_state(&function_state_, &scope_, *scope, 936 FunctionState function_state(&function_state_, &scope_, *scope,
937 kNormalFunction, &function_factory); 937 kNormalFunction, &function_factory);
938 938
939 scope_->SetLanguageMode(info->language_mode()); 939 scope_->SetLanguageMode(info->language_mode());
940 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone()); 940 ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone());
941 bool ok = true; 941 bool ok = true;
942 int beg_pos = scanner()->location().beg_pos; 942 int beg_pos = scanner()->location().beg_pos;
943 if (info->is_module()) { 943 if (info->is_module()) {
944 DCHECK(allow_harmony_modules()); 944 DCHECK(allow_harmony_modules());
945 ParseModule(body, &ok); 945 ParseModuleItemList(body, &ok);
946 } else { 946 } else {
947 ParseStatementList(body, Token::EOS, info->is_eval(), eval_scope, &ok); 947 ParseStatementList(body, Token::EOS, info->is_eval(), eval_scope, &ok);
948 } 948 }
949 949
950 if (ok && is_strict(language_mode())) { 950 if (ok && is_strict(language_mode())) {
951 CheckStrictOctalLiteral(beg_pos, scanner()->location().end_pos, &ok); 951 CheckStrictOctalLiteral(beg_pos, scanner()->location().end_pos, &ok);
952 } 952 }
953 953
954 if (ok && allow_harmony_scoping() && is_strict(language_mode())) { 954 if (ok && allow_harmony_scoping() && is_strict(language_mode())) {
955 CheckConflictingVarDeclarations(scope_, &ok); 955 CheckConflictingVarDeclarations(scope_, &ok);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 case Token::IMPORT: 1235 case Token::IMPORT:
1236 return ParseImportDeclaration(ok); 1236 return ParseImportDeclaration(ok);
1237 case Token::EXPORT: 1237 case Token::EXPORT:
1238 return ParseExportDeclaration(ok); 1238 return ParseExportDeclaration(ok);
1239 default: 1239 default:
1240 return ParseStatementListItem(ok); 1240 return ParseStatementListItem(ok);
1241 } 1241 }
1242 } 1242 }
1243 1243
1244 1244
1245 void* Parser::ParseModule(ZoneList<Statement*>* body, bool* ok) { 1245 void* Parser::ParseModuleItemList(ZoneList<Statement*>* body, bool* ok) {
1246 // (Ecma 262 6th Edition, 15.2): 1246 // (Ecma 262 6th Edition, 15.2):
1247 // Module : 1247 // Module :
1248 // ModuleBody? 1248 // ModuleBody?
1249 // 1249 //
1250 // ModuleBody : 1250 // ModuleBody :
1251 // ModuleItem* 1251 // ModuleItem*
1252 1252
1253 DCHECK(scope_->is_module_scope()); 1253 DCHECK(scope_->is_module_scope());
1254 scope_->SetLanguageMode( 1254 scope_->SetLanguageMode(
1255 static_cast<LanguageMode>(scope_->language_mode() | STRICT_BIT)); 1255 static_cast<LanguageMode>(scope_->language_mode() | STRICT_BIT));
(...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after
5419 } else { 5419 } else {
5420 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); 5420 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data());
5421 running_hash = StringHasher::ComputeRunningHash(running_hash, data, 5421 running_hash = StringHasher::ComputeRunningHash(running_hash, data,
5422 raw_string->length()); 5422 raw_string->length());
5423 } 5423 }
5424 } 5424 }
5425 5425
5426 return running_hash; 5426 return running_hash;
5427 } 5427 }
5428 } } // namespace v8::internal 5428 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698