| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 LetNode::LetNode(intptr_t token_pos) | 79 LetNode::LetNode(intptr_t token_pos) |
| 80 : AstNode(token_pos), | 80 : AstNode(token_pos), |
| 81 vars_(1), | 81 vars_(1), |
| 82 initializers_(1), | 82 initializers_(1), |
| 83 nodes_(1) { } | 83 nodes_(1) { } |
| 84 | 84 |
| 85 | 85 |
| 86 LocalVariable* LetNode::AddInitializer(AstNode* node) { | 86 LocalVariable* LetNode::AddInitializer(AstNode* node) { |
| 87 initializers_.Add(node); | 87 initializers_.Add(node); |
| 88 char name[64]; | 88 char name[64]; |
| 89 OS::SNPrint(name, sizeof(name), ":lt%" Pd "_%d", token_pos(), vars_.length()); | 89 OS::SNPrint(name, sizeof(name), ":lt%" Pd "_%" Pd "", |
| 90 token_pos(), vars_.length()); |
| 90 LocalVariable* temp_var = | 91 LocalVariable* temp_var = |
| 91 new LocalVariable(token_pos(), | 92 new LocalVariable(token_pos(), |
| 92 String::ZoneHandle(Symbols::New(name)), | 93 String::ZoneHandle(Symbols::New(name)), |
| 93 Type::ZoneHandle(Type::DynamicType())); | 94 Type::ZoneHandle(Type::DynamicType())); |
| 94 vars_.Add(temp_var); | 95 vars_.Add(temp_var); |
| 95 return temp_var; | 96 return temp_var; |
| 96 } | 97 } |
| 97 | 98 |
| 98 | 99 |
| 99 void LetNode::VisitChildren(AstNodeVisitor* visitor) const { | 100 void LetNode::VisitChildren(AstNodeVisitor* visitor) const { |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 if (result.IsError() || result.IsNull()) { | 573 if (result.IsError() || result.IsNull()) { |
| 573 // TODO(turnidge): We could get better error messages by returning | 574 // TODO(turnidge): We could get better error messages by returning |
| 574 // the Error object directly to the parser. This will involve | 575 // the Error object directly to the parser. This will involve |
| 575 // replumbing all of the EvalConstExpr methods. | 576 // replumbing all of the EvalConstExpr methods. |
| 576 return NULL; | 577 return NULL; |
| 577 } | 578 } |
| 578 return &Instance::ZoneHandle(Instance::Cast(result).raw()); | 579 return &Instance::ZoneHandle(Instance::Cast(result).raw()); |
| 579 } | 580 } |
| 580 | 581 |
| 581 } // namespace dart | 582 } // namespace dart |
| OLD | NEW |