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

Side by Side Diff: runtime/vm/ast.h

Issue 538803002: Enable await in for and for-in loops. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase on master Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_AST_H_ 5 #ifndef VM_AST_H_
6 #define VM_AST_H_ 6 #define VM_AST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 }; 1026 };
1027 1027
1028 1028
1029 // The condition can be NULL. 1029 // The condition can be NULL.
1030 class ForNode : public AstNode { 1030 class ForNode : public AstNode {
1031 public: 1031 public:
1032 ForNode(intptr_t token_pos, 1032 ForNode(intptr_t token_pos,
1033 SourceLabel* label, 1033 SourceLabel* label,
1034 SequenceNode* initializer, 1034 SequenceNode* initializer,
1035 AstNode* condition, 1035 AstNode* condition,
1036 SequenceNode* condition_preamble,
1036 SequenceNode* increment, 1037 SequenceNode* increment,
1037 SequenceNode* body) 1038 SequenceNode* body)
1038 : AstNode(token_pos), 1039 : AstNode(token_pos),
1039 label_(label), 1040 label_(label),
1040 initializer_(initializer), 1041 initializer_(initializer),
1041 condition_(condition), 1042 condition_(condition),
1043 condition_preamble_(condition_preamble),
1042 increment_(increment), 1044 increment_(increment),
1043 body_(body) { 1045 body_(body) {
1044 ASSERT(label_ != NULL); 1046 ASSERT(label_ != NULL);
1045 ASSERT(initializer_ != NULL); 1047 ASSERT(initializer_ != NULL);
1046 ASSERT(increment_ != NULL); 1048 ASSERT(increment_ != NULL);
1047 ASSERT(body_ != NULL); 1049 ASSERT(body_ != NULL);
1048 } 1050 }
1049 1051
1050 SourceLabel* label() const { return label_; } 1052 SourceLabel* label() const { return label_; }
1051 SequenceNode* initializer() const { return initializer_; } 1053 SequenceNode* initializer() const { return initializer_; }
1052 AstNode* condition() const { return condition_; } 1054 AstNode* condition() const { return condition_; }
1055 AstNode* condition_preamble() const { return condition_preamble_; }
1053 SequenceNode* increment() const { return increment_; } 1056 SequenceNode* increment() const { return increment_; }
1054 SequenceNode* body() const { return body_; } 1057 SequenceNode* body() const { return body_; }
1055 1058
1056 virtual void VisitChildren(AstNodeVisitor* visitor) const { 1059 virtual void VisitChildren(AstNodeVisitor* visitor) const {
1057 initializer()->Visit(visitor); 1060 initializer()->Visit(visitor);
1061 if (condition_preamble() != NULL) {
1062 ASSERT(condition() != NULL);
1063 condition_preamble()->Visit(visitor);
1064 }
1058 if (condition() != NULL) { 1065 if (condition() != NULL) {
1059 condition()->Visit(visitor); 1066 condition()->Visit(visitor);
1060 } 1067 }
1061 increment()->Visit(visitor); 1068 increment()->Visit(visitor);
1062 body()->Visit(visitor); 1069 body()->Visit(visitor);
1063 } 1070 }
1064 1071
1065 DECLARE_COMMON_NODE_FUNCTIONS(ForNode); 1072 DECLARE_COMMON_NODE_FUNCTIONS(ForNode);
1066 1073
1067 private: 1074 private:
1068 SourceLabel* label_; 1075 SourceLabel* label_;
1069 SequenceNode* initializer_; 1076 SequenceNode* initializer_;
1070 AstNode* condition_; 1077 AstNode* condition_;
1078 AstNode* condition_preamble_;
1071 SequenceNode* increment_; 1079 SequenceNode* increment_;
1072 SequenceNode* body_; 1080 SequenceNode* body_;
1073 1081
1074 DISALLOW_IMPLICIT_CONSTRUCTORS(ForNode); 1082 DISALLOW_IMPLICIT_CONSTRUCTORS(ForNode);
1075 }; 1083 };
1076 1084
1077 1085
1078 class JumpNode : public AstNode { 1086 class JumpNode : public AstNode {
1079 public: 1087 public:
1080 JumpNode(intptr_t token_pos, 1088 JumpNode(intptr_t token_pos,
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 const intptr_t try_index_; 1913 const intptr_t try_index_;
1906 1914
1907 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 1915 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
1908 }; 1916 };
1909 1917
1910 } // namespace dart 1918 } // namespace dart
1911 1919
1912 #undef DECLARE_COMMON_NODE_FUNCTIONS 1920 #undef DECLARE_COMMON_NODE_FUNCTIONS
1913 1921
1914 #endif // VM_AST_H_ 1922 #endif // VM_AST_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698