| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library fasta.builder; | 5 library fasta.builder; |
| 6 | 6 |
| 7 import '../errors.dart' show | 7 import '../errors.dart' show |
| 8 internalError; | 8 internalError; |
| 9 | 9 |
| 10 import '../messages.dart' show | 10 import '../messages.dart' show |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 /// The values of [parent], [charOffset], and [fileUri] aren't stored. We | 93 /// The values of [parent], [charOffset], and [fileUri] aren't stored. We |
| 94 /// need to evaluate the memory impact of doing so, but want to ensure the | 94 /// need to evaluate the memory impact of doing so, but want to ensure the |
| 95 /// information is always provided. | 95 /// information is always provided. |
| 96 Builder(Builder parent, int charOffset, Uri fileUri); | 96 Builder(Builder parent, int charOffset, Uri fileUri); |
| 97 | 97 |
| 98 int get charOffset => -1; | 98 int get charOffset => -1; |
| 99 | 99 |
| 100 Uri get fileUri => null; | 100 Uri get fileUri => null; |
| 101 | 101 |
| 102 String get relativeFileUri { |
| 103 throw "The relativeFileUri method should be only called on subclasses " |
| 104 "which have an efficient implementation of `relativeFileUri`!"; |
| 105 } |
| 106 |
| 102 /// Resolve types (lookup names in scope) recorded in this builder and return | 107 /// Resolve types (lookup names in scope) recorded in this builder and return |
| 103 /// the number of types resolved. | 108 /// the number of types resolved. |
| 104 int resolveTypes(covariant Builder parent) => 0; | 109 int resolveTypes(covariant Builder parent) => 0; |
| 105 | 110 |
| 106 /// Resolve constructors (lookup names in scope) recorded in this builder and | 111 /// Resolve constructors (lookup names in scope) recorded in this builder and |
| 107 /// return the number of constructors resolved. | 112 /// return the number of constructors resolved. |
| 108 int resolveConstructors(covariant Builder parent) => 0; | 113 int resolveConstructors(covariant Builder parent) => 0; |
| 109 | 114 |
| 110 /// This builder and [other] has been imported into [library] using [name]. | 115 /// This builder and [other] has been imported into [library] using [name]. |
| 111 /// | 116 /// |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 182 |
| 178 static Uri getUri(Builder builder) { | 183 static Uri getUri(Builder builder) { |
| 179 if (builder == null) return internalError("Builder is null."); | 184 if (builder == null) return internalError("Builder is null."); |
| 180 while (builder != null) { | 185 while (builder != null) { |
| 181 if (builder is LibraryBuilder) return builder.uri; | 186 if (builder is LibraryBuilder) return builder.uri; |
| 182 builder = builder.parent; | 187 builder = builder.parent; |
| 183 } | 188 } |
| 184 return internalError("No library parent."); | 189 return internalError("No library parent."); |
| 185 } | 190 } |
| 186 } | 191 } |
| OLD | NEW |