Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 651 false_expr_(false_expr) { | 651 false_expr_(false_expr) { |
| 652 ASSERT(condition_ != NULL); | 652 ASSERT(condition_ != NULL); |
| 653 ASSERT(true_expr_ != NULL); | 653 ASSERT(true_expr_ != NULL); |
| 654 ASSERT(false_expr_ != NULL); | 654 ASSERT(false_expr_ != NULL); |
| 655 } | 655 } |
| 656 | 656 |
| 657 AstNode* condition() const { return condition_; } | 657 AstNode* condition() const { return condition_; } |
| 658 AstNode* true_expr() const { return true_expr_; } | 658 AstNode* true_expr() const { return true_expr_; } |
| 659 AstNode* false_expr() const { return false_expr_; } | 659 AstNode* false_expr() const { return false_expr_; } |
| 660 | 660 |
| 661 void set_true_expr(AstNode* true_expr) { | |
| 662 ASSERT(true_expr_ != NULL); | |
|
srdjan
2012/05/31 15:39:11
Why are these asserts necessary? Dop you want to c
regis
2012/05/31 15:56:24
Yes, of course. Copy and paste error. Thanks!
| |
| 663 true_expr_ = true_expr; | |
| 664 } | |
| 665 void set_false_expr(AstNode* false_expr) { | |
| 666 ASSERT(false_expr_ != NULL); | |
| 667 false_expr_ = false_expr; | |
| 668 } | |
| 669 | |
| 661 virtual void VisitChildren(AstNodeVisitor* visitor) const { | 670 virtual void VisitChildren(AstNodeVisitor* visitor) const { |
| 662 condition()->Visit(visitor); | 671 condition()->Visit(visitor); |
| 663 true_expr()->Visit(visitor); | 672 true_expr()->Visit(visitor); |
| 664 false_expr()->Visit(visitor); | 673 false_expr()->Visit(visitor); |
| 665 } | 674 } |
| 666 | 675 |
| 667 DECLARE_COMMON_NODE_FUNCTIONS(ConditionalExprNode); | 676 DECLARE_COMMON_NODE_FUNCTIONS(ConditionalExprNode); |
| 668 | 677 |
| 669 private: | 678 private: |
| 670 AstNode* condition_; | 679 AstNode* condition_; |
| (...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1661 const LocalVariable& context_var_; | 1670 const LocalVariable& context_var_; |
| 1662 | 1671 |
| 1663 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1672 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 1664 }; | 1673 }; |
| 1665 | 1674 |
| 1666 } // namespace dart | 1675 } // namespace dart |
| 1667 | 1676 |
| 1668 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1677 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 1669 | 1678 |
| 1670 #endif // VM_AST_H_ | 1679 #endif // VM_AST_H_ |
| OLD | NEW |