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

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

Issue 2339453002: [parser] Refactor of Parse*Statement*, part 7 (Closed)
Patch Set: The real patch Created 4 years, 3 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') | src/parsing/parser.cc » ('J')
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 const DeclarationParsingResult::Declaration* declaration, 277 const DeclarationParsingResult::Declaration* declaration,
278 ZoneList<const AstRawString*>* names, bool* ok); 278 ZoneList<const AstRawString*>* names, bool* ok);
279 ZoneList<const AstRawString*>* DeclareLabel( 279 ZoneList<const AstRawString*>* DeclareLabel(
280 ZoneList<const AstRawString*>* labels, VariableProxy* expr, bool* ok); 280 ZoneList<const AstRawString*>* labels, VariableProxy* expr, bool* ok);
281 bool ContainsLabel(ZoneList<const AstRawString*>* labels, 281 bool ContainsLabel(ZoneList<const AstRawString*>* labels,
282 const AstRawString* label); 282 const AstRawString* label);
283 Expression* RewriteReturn(Expression* return_value, int pos); 283 Expression* RewriteReturn(Expression* return_value, int pos);
284 Statement* RewriteSwitchStatement(Expression* tag, 284 Statement* RewriteSwitchStatement(Expression* tag,
285 SwitchStatement* switch_statement, 285 SwitchStatement* switch_statement,
286 ZoneList<CaseClause*>* cases, Scope* scope); 286 ZoneList<CaseClause*>* cases, Scope* scope);
287 void RewriteCatchPattern(CatchInfo* catch_info, bool* ok);
288 void ValidateCatchBlock(const CatchInfo& catch_info, bool* ok);
289 Statement* RewriteTryStatement(Block* try_block, Block* catch_block,
290 Block* finally_block,
291 const CatchInfo& catch_info, int pos,
292 bool* ok);
287 293
288 Statement* DeclareFunction(const AstRawString* variable_name, 294 Statement* DeclareFunction(const AstRawString* variable_name,
289 FunctionLiteral* function, int pos, 295 FunctionLiteral* function, int pos,
290 bool is_generator, bool is_async, 296 bool is_generator, bool is_async,
291 ZoneList<const AstRawString*>* names, bool* ok); 297 ZoneList<const AstRawString*>* names, bool* ok);
292 298
293 Expression* ParseYieldStarExpression(bool* ok); 299 Expression* ParseYieldStarExpression(bool* ok);
294 300
295 class PatternRewriter final : public AstVisitor<PatternRewriter> { 301 class PatternRewriter final : public AstVisitor<PatternRewriter> {
296 public: 302 public:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 const DeclarationDescriptor* descriptor_; 373 const DeclarationDescriptor* descriptor_;
368 ZoneList<const AstRawString*>* names_; 374 ZoneList<const AstRawString*>* names_;
369 Expression* current_value_; 375 Expression* current_value_;
370 int recursion_level_; 376 int recursion_level_;
371 bool* ok_; 377 bool* ok_;
372 378
373 DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW() 379 DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW()
374 }; 380 };
375 381
376 Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok); 382 Statement* ParseForStatement(ZoneList<const AstRawString*>* labels, bool* ok);
377 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value); 383 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value);
nickie 2016/09/14 08:14:04 Also, this declaration is redundant (there's no de
378 TryStatement* ParseTryStatement(bool* ok);
379 384
380 // !%_IsJSReceiver(result = iterator.next()) && 385 // !%_IsJSReceiver(result = iterator.next()) &&
381 // %ThrowIteratorResultNotAnObject(result) 386 // %ThrowIteratorResultNotAnObject(result)
382 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result, 387 Expression* BuildIteratorNextResult(Expression* iterator, Variable* result,
383 int pos); 388 int pos);
384 389
385 Expression* GetIterator(Expression* iterable, int pos); 390 Expression* GetIterator(Expression* iterable, int pos);
386 391
387 // Initialize the components of a for-in / for-of statement. 392 // Initialize the components of a for-in / for-of statement.
388 Statement* InitializeForEachStatement(ForEachStatement* stmt, 393 Statement* InitializeForEachStatement(ForEachStatement* stmt,
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 1078
1074 #ifdef DEBUG 1079 #ifdef DEBUG
1075 void Print(AstNode* node); 1080 void Print(AstNode* node);
1076 #endif // DEBUG 1081 #endif // DEBUG
1077 }; 1082 };
1078 1083
1079 } // namespace internal 1084 } // namespace internal
1080 } // namespace v8 1085 } // namespace v8
1081 1086
1082 #endif // V8_PARSING_PARSER_H_ 1087 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698