OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/ast.h" | 5 #include "vm/ast.h" |
6 #include "vm/compiler.h" | 6 #include "vm/compiler.h" |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
10 #include "vm/resolver.h" | 10 #include "vm/resolver.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 | 93 |
94 LocalVariable* LetNode::AddInitializer(AstNode* node) { | 94 LocalVariable* LetNode::AddInitializer(AstNode* node) { |
95 initializers_.Add(node); | 95 initializers_.Add(node); |
96 char name[64]; | 96 char name[64]; |
97 OS::SNPrint(name, sizeof(name), ":lt%" Pd "_%" Pd "", | 97 OS::SNPrint(name, sizeof(name), ":lt%" Pd "_%" Pd "", |
98 token_pos(), vars_.length()); | 98 token_pos(), vars_.length()); |
99 LocalVariable* temp_var = | 99 LocalVariable* temp_var = |
100 new LocalVariable(token_pos(), | 100 new LocalVariable(token_pos(), |
101 String::ZoneHandle(Symbols::New(name)), | 101 String::ZoneHandle(Symbols::New(name)), |
102 Type::ZoneHandle(Type::DynamicType())); | 102 Object::dynamic_type()); |
103 vars_.Add(temp_var); | 103 vars_.Add(temp_var); |
104 return temp_var; | 104 return temp_var; |
105 } | 105 } |
106 | 106 |
107 | 107 |
108 void LetNode::VisitChildren(AstNodeVisitor* visitor) const { | 108 void LetNode::VisitChildren(AstNodeVisitor* visitor) const { |
109 for (intptr_t i = 0; i < num_temps(); ++i) { | 109 for (intptr_t i = 0; i < num_temps(); ++i) { |
110 initializers_[i]->Visit(visitor); | 110 initializers_[i]->Visit(visitor); |
111 } | 111 } |
112 for (intptr_t i = 0; i < nodes_.length(); ++i) { | 112 for (intptr_t i = 0; i < nodes_.length(); ++i) { |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 if (result.IsError() || result.IsNull()) { | 773 if (result.IsError() || result.IsNull()) { |
774 // TODO(turnidge): We could get better error messages by returning | 774 // TODO(turnidge): We could get better error messages by returning |
775 // the Error object directly to the parser. This will involve | 775 // the Error object directly to the parser. This will involve |
776 // replumbing all of the EvalConstExpr methods. | 776 // replumbing all of the EvalConstExpr methods. |
777 return NULL; | 777 return NULL; |
778 } | 778 } |
779 return &Instance::ZoneHandle(Instance::Cast(result).raw()); | 779 return &Instance::ZoneHandle(Instance::Cast(result).raw()); |
780 } | 780 } |
781 | 781 |
782 } // namespace dart | 782 } // namespace dart |
OLD | NEW |