Chromium Code Reviews| 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 * The base type for all nodes in a dart abstract syntax tree. | 5 * The base type for all nodes in a dart abstract syntax tree. |
| 6 */ | 6 */ |
| 7 class Node { | 7 class Node { |
| 8 /** The source code this [Node] represents. */ | 8 /** The source code this [Node] represents. */ |
| 9 SourceSpan span; | 9 SourceSpan span; |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 /** The base type for expressions. */ | 38 /** The base type for expressions. */ |
| 39 class Expression extends Node { | 39 class Expression extends Node { |
| 40 Expression(SourceSpan span): super(span) {} | 40 Expression(SourceSpan span): super(span) {} |
| 41 } | 41 } |
| 42 | 42 |
| 43 class TypeReference extends Node { | 43 class TypeReference extends Node { |
| 44 Type type; | 44 Type type; |
| 45 TypeReference(SourceSpan span, [this.type=null]): super(span) {} | 45 TypeReference(SourceSpan span, [this.type=null]): super(span) {} |
| 46 | 46 |
| 47 visit(TreeVisitor visitor) => visitor.visitTypeReference(this); | 47 visit(TreeVisitor visitor) => visitor.visitTypeReference(this); |
| 48 | |
| 49 bool get isFinal() => false; | |
|
jimhug
2011/11/17 15:36:15
You mean you're going to get the type system right
| |
| 48 } | 50 } |
| 49 | 51 |
| 50 // TODO(jimhug): Clean-up and factor out of core. | 52 // TODO(jimhug): Clean-up and factor out of core. |
| 51 /** Simple class to provide a textual dump of trees for debugging. */ | 53 /** Simple class to provide a textual dump of trees for debugging. */ |
| 52 class TreeOutput { | 54 class TreeOutput { |
| 53 int depth; | 55 int depth; |
| 54 StringBuffer buf; | 56 StringBuffer buf; |
| 55 | 57 |
| 56 var printer; | 58 var printer; |
| 57 | 59 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 if (node != null) { | 124 if (node != null) { |
| 123 node.visit(printer); | 125 node.visit(printer); |
| 124 } else { | 126 } else { |
| 125 writeln('null'); | 127 writeln('null'); |
| 126 } | 128 } |
| 127 } | 129 } |
| 128 depth -= 1; | 130 depth -= 1; |
| 129 } | 131 } |
| 130 } | 132 } |
| 131 } | 133 } |
| OLD | NEW |