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

Unified Diff: runtime/vm/ast.h

Issue 484933003: Await it! (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/ast_printer.cc » ('j') | runtime/vm/ast_transformer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index 7c1279b4fa58df4e01c3b4a5025664d3e6afa18f..62eb4bbf55c0f842dabe7a052bc8428a9a9a2fd3 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -17,6 +17,7 @@ namespace dart {
#define FOR_EACH_NODE(V) \
V(Await) \
+ V(AwaitMarker) \
V(Return) \
V(Literal) \
V(Type) \
@@ -168,6 +169,33 @@ class AwaitNode : public AstNode {
};
+class AwaitMarkerNode : public AstNode {
+ public:
+ enum Type {
+ kNewContinuationState,
+ kTargetForContinuation,
+ };
+
+ explicit AwaitMarkerNode(Type type)
+ : AstNode(Scanner::kNoSourcePos), type_(type) { }
+
+ void VisitChildren(AstNodeVisitor* visitor) const { }
+
+ Type type() const { return type_; }
+
+ LocalScope* scope() const { return scope_; }
+ void set_scope(LocalScope* scope) { scope_ = scope; }
+
+ DECLARE_COMMON_NODE_FUNCTIONS(AwaitMarkerNode);
+
+ private:
+ Type type_;
+ LocalScope* scope_;
+
+ DISALLOW_COPY_AND_ASSIGN(AwaitMarkerNode);
+};
+
+
class SequenceNode : public AstNode {
public:
SequenceNode(intptr_t token_pos, LocalScope* scope)
@@ -537,8 +565,6 @@ class PrimaryNode : public AstNode {
};
-// TODO(mlippautz): Implement return nodes that are used to return from a
-// continuation.
class ReturnNode : public AstNode {
public:
// Return from a void function returns the null object.
@@ -580,6 +606,9 @@ class ReturnNode : public AstNode {
// Returns false if the return node is used to return from a continuation.
bool is_regular_return() const { return is_regular_return_; }
+ void set_is_regular_return(bool is_regular_return) {
+ is_regular_return_ = is_regular_return;
+ }
DECLARE_COMMON_NODE_FUNCTIONS(ReturnNode);
« no previous file with comments | « no previous file | runtime/vm/ast_printer.cc » ('j') | runtime/vm/ast_transformer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698