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

Side by Side Diff: src/parsing/parser.h

Issue 2376293002: [parser] Refactor of ParseFunctionDeclaration (Closed)
Patch Set: The real patch Created 4 years, 2 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/parsing/parser.cc » ('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 #ifndef V8_PARSING_PARSER_H_ 5 #ifndef V8_PARSING_PARSER_H_
6 #define V8_PARSING_PARSER_H_ 6 #define V8_PARSING_PARSER_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/parsing/parser-base.h" 10 #include "src/parsing/parser-base.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 const AstRawString* import_name; 262 const AstRawString* import_name;
263 const AstRawString* local_name; 263 const AstRawString* local_name;
264 const Scanner::Location location; 264 const Scanner::Location location;
265 NamedImport(const AstRawString* import_name, const AstRawString* local_name, 265 NamedImport(const AstRawString* import_name, const AstRawString* local_name,
266 Scanner::Location location) 266 Scanner::Location location)
267 : import_name(import_name), 267 : import_name(import_name),
268 local_name(local_name), 268 local_name(local_name),
269 location(location) {} 269 location(location) {}
270 }; 270 };
271 ZoneList<const NamedImport*>* ParseNamedImports(int pos, bool* ok); 271 ZoneList<const NamedImport*>* ParseNamedImports(int pos, bool* ok);
272 Statement* ParseFunctionDeclaration(bool* ok);
273 Block* BuildInitializationBlock(DeclarationParsingResult* parsing_result, 272 Block* BuildInitializationBlock(DeclarationParsingResult* parsing_result,
274 ZoneList<const AstRawString*>* names, 273 ZoneList<const AstRawString*>* names,
275 bool* ok); 274 bool* ok);
276 void DeclareAndInitializeVariables( 275 void DeclareAndInitializeVariables(
277 Block* block, const DeclarationDescriptor* declaration_descriptor, 276 Block* block, const DeclarationDescriptor* declaration_descriptor,
278 const DeclarationParsingResult::Declaration* declaration, 277 const DeclarationParsingResult::Declaration* declaration,
279 ZoneList<const AstRawString*>* names, bool* ok); 278 ZoneList<const AstRawString*>* names, bool* ok);
280 ZoneList<const AstRawString*>* DeclareLabel( 279 ZoneList<const AstRawString*>* DeclareLabel(
281 ZoneList<const AstRawString*>* labels, VariableProxy* expr, bool* ok); 280 ZoneList<const AstRawString*>* labels, VariableProxy* expr, bool* ok);
282 bool ContainsLabel(ZoneList<const AstRawString*>* labels, 281 bool ContainsLabel(ZoneList<const AstRawString*>* labels,
(...skipping 21 matching lines...) Expand all
304 int class_token_pos, bool* ok); 303 int class_token_pos, bool* ok);
305 V8_INLINE void DeclareClassProperty(const AstRawString* class_name, 304 V8_INLINE void DeclareClassProperty(const AstRawString* class_name,
306 ClassLiteralProperty* property, 305 ClassLiteralProperty* property,
307 ClassInfo* class_info, bool* ok); 306 ClassInfo* class_info, bool* ok);
308 V8_INLINE Expression* RewriteClassLiteral(const AstRawString* name, 307 V8_INLINE Expression* RewriteClassLiteral(const AstRawString* name,
309 ClassInfo* class_info, int pos, 308 ClassInfo* class_info, int pos,
310 bool* ok); 309 bool* ok);
311 V8_INLINE Statement* DeclareNative(const AstRawString* name, int pos, 310 V8_INLINE Statement* DeclareNative(const AstRawString* name, int pos,
312 bool* ok); 311 bool* ok);
313 312
314 Expression* ParseYieldStarExpression(bool* ok);
315
316 class PatternRewriter final : public AstVisitor<PatternRewriter> { 313 class PatternRewriter final : public AstVisitor<PatternRewriter> {
317 public: 314 public:
318 static void DeclareAndInitializeVariables( 315 static void DeclareAndInitializeVariables(
319 Parser* parser, Block* block, 316 Parser* parser, Block* block,
320 const DeclarationDescriptor* declaration_descriptor, 317 const DeclarationDescriptor* declaration_descriptor,
321 const DeclarationParsingResult::Declaration* declaration, 318 const DeclarationParsingResult::Declaration* declaration,
322 ZoneList<const AstRawString*>* names, bool* ok); 319 ZoneList<const AstRawString*>* names, bool* ok);
323 320
324 static void RewriteDestructuringAssignment(Parser* parser, 321 static void RewriteDestructuringAssignment(Parser* parser,
325 RewritableExpression* expr, 322 RewritableExpression* expr,
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 int total_preparse_skipped_; 1087 int total_preparse_skipped_;
1091 HistogramTimer* pre_parse_timer_; 1088 HistogramTimer* pre_parse_timer_;
1092 1089
1093 bool parsing_on_main_thread_; 1090 bool parsing_on_main_thread_;
1094 }; 1091 };
1095 1092
1096 } // namespace internal 1093 } // namespace internal
1097 } // namespace v8 1094 } // namespace v8
1098 1095
1099 #endif // V8_PARSING_PARSER_H_ 1096 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698