| 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 class TreeValidatorTask extends CompilerTask { | 5 class TreeValidatorTask extends CompilerTask { |
| 6 TreeValidatorTask(Compiler compiler) : super(compiler); | 6 TreeValidatorTask(Compiler compiler) : super(compiler); |
| 7 | 7 |
| 8 void validate(Node tree) { | 8 void validate(Node tree) { |
| 9 assert(check(tree)); | 9 assert(check(tree)); |
| 10 } | 10 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 class InvalidNodeError { | 57 class InvalidNodeError { |
| 58 final Node node; | 58 final Node node; |
| 59 final String message; | 59 final String message; |
| 60 InvalidNodeError(this.node, [this.message]); | 60 InvalidNodeError(this.node, [this.message]); |
| 61 | 61 |
| 62 toString() { | 62 toString() { |
| 63 String nodeString = new Unparser(true).unparse(node); | 63 String nodeString = new Unparser().unparse(node); |
| 64 String result = 'invalid node: $nodeString'; | 64 String result = 'invalid node: $nodeString'; |
| 65 if (message !== null) result = '$result ($message)'; | 65 if (message !== null) result = '$result ($message)'; |
| 66 return result; | 66 return result; |
| 67 } | 67 } |
| 68 } | 68 } |
| OLD | NEW |