| Index: runtime/vm/parser.h
|
| diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
|
| index b2fbfe64f738404fcdd7f834e1e90183c2e39638..c5b1b22da8c5ca449053fca2efeda55b9fbd203a 100644
|
| --- a/runtime/vm/parser.h
|
| +++ b/runtime/vm/parser.h
|
| @@ -47,11 +47,14 @@ class ParsedFunction : public ZoneAllocated {
|
| saved_current_context_var_(NULL),
|
| saved_entry_context_var_(NULL),
|
| expression_temp_var_(NULL),
|
| + await_temps_scope_(NULL),
|
| deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()),
|
| first_parameter_index_(0),
|
| first_stack_local_index_(0),
|
| num_copied_params_(0),
|
| num_stack_locals_(0),
|
| + num_awaits_(0),
|
| + seen_await_expr_(false),
|
| isolate_(isolate) {
|
| ASSERT(function.IsZoneHandle());
|
| }
|
| @@ -123,6 +126,23 @@ class ParsedFunction : public ZoneAllocated {
|
|
|
| void AllocateVariables();
|
|
|
| + void set_await_temps_scope(LocalScope* scope) {
|
| + ASSERT(await_temps_scope_ == NULL);
|
| + await_temps_scope_ = scope;
|
| + }
|
| + LocalScope* await_temps_scope() const {
|
| + ASSERT(await_temps_scope_ != NULL);
|
| + return await_temps_scope_;
|
| + }
|
| +
|
| + int num_awaits() const { return num_awaits_; }
|
| + void record_await() {
|
| + num_awaits_++;
|
| + seen_await_expr_ = true;
|
| + }
|
| + void reset_seen_await() { seen_await_expr_ = false; }
|
| + bool seen_await() const { return seen_await_expr_; }
|
| +
|
| Isolate* isolate() const { return isolate_; }
|
|
|
| private:
|
| @@ -134,12 +154,15 @@ class ParsedFunction : public ZoneAllocated {
|
| LocalVariable* saved_current_context_var_;
|
| LocalVariable* saved_entry_context_var_;
|
| LocalVariable* expression_temp_var_;
|
| + LocalScope* await_temps_scope_;
|
| ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_;
|
|
|
| int first_parameter_index_;
|
| int first_stack_local_index_;
|
| int num_copied_params_;
|
| int num_stack_locals_;
|
| + int num_awaits_;
|
| + bool seen_await_expr_;
|
|
|
| Isolate* isolate_;
|
|
|
| @@ -486,6 +509,7 @@ class Parser : public ValueObject {
|
| void OpenBlock();
|
| void OpenLoopBlock();
|
| void OpenFunctionBlock(const Function& func);
|
| + void OpenAsyncClosure();
|
| RawFunction* OpenAsyncFunction(intptr_t formal_param_pos);
|
| SequenceNode* CloseBlock();
|
| SequenceNode* CloseAsyncFunction(const Function& closure,
|
| @@ -570,6 +594,9 @@ class Parser : public ValueObject {
|
| static const bool kAllowConst = false;
|
| static const bool kConsumeCascades = true;
|
| static const bool kNoCascades = false;
|
| + AstNode* ParseAwaitableExpr(bool require_compiletime_const,
|
| + bool consume_cascades);
|
| + AstNode* ParseAwaitExpr();
|
| AstNode* ParseExpr(bool require_compiletime_const, bool consume_cascades);
|
| AstNode* ParseExprList();
|
| AstNode* ParseConditionalExpr();
|
|
|