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

Side by Side Diff: src/preparser.cc

Issue 915383002: Parser / PreParser: trivial unifications (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . 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 | « src/preparser.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // 173 //
174 // LexicalDeclaration[In, Yield] : 174 // LexicalDeclaration[In, Yield] :
175 // LetOrConst BindingList[?In, ?Yield] ; 175 // LetOrConst BindingList[?In, ?Yield] ;
176 176
177 switch (peek()) { 177 switch (peek()) {
178 case Token::FUNCTION: 178 case Token::FUNCTION:
179 return ParseFunctionDeclaration(ok); 179 return ParseFunctionDeclaration(ok);
180 case Token::CLASS: 180 case Token::CLASS:
181 return ParseClassDeclaration(ok); 181 return ParseClassDeclaration(ok);
182 case Token::CONST: 182 case Token::CONST:
183 return ParseVariableStatement(kSourceElement, ok); 183 return ParseVariableStatement(kStatementListItem, ok);
184 case Token::LET: 184 case Token::LET:
185 DCHECK(allow_harmony_scoping()); 185 DCHECK(allow_harmony_scoping());
186 if (is_strict(language_mode())) { 186 if (is_strict(language_mode())) {
187 return ParseVariableStatement(kSourceElement, ok); 187 return ParseVariableStatement(kStatementListItem, ok);
188 } 188 }
189 // Fall through. 189 // Fall through.
190 default: 190 default:
191 return ParseStatement(ok); 191 return ParseStatement(ok);
192 } 192 }
193 } 193 }
194 194
195 195
196 void PreParser::ParseStatementList(int end_token, bool* ok) { 196 void PreParser::ParseStatementList(int end_token, bool* ok) {
197 // SourceElements :: 197 // SourceElements ::
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 1018 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
1019 ParseArguments(ok); 1019 ParseArguments(ok);
1020 1020
1021 return Expression::Default(); 1021 return Expression::Default();
1022 } 1022 }
1023 1023
1024 #undef CHECK_OK 1024 #undef CHECK_OK
1025 1025
1026 1026
1027 } } // v8::internal 1027 } } // v8::internal
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698