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.library_builder; | 5 library fasta.library_builder; |
6 | 6 |
7 import '../combinator.dart' show Combinator; | 7 import '../combinator.dart' show Combinator; |
8 | 8 |
9 import '../errors.dart' show internalError; | 9 import '../errors.dart' show internalError; |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 final Uri fileUri; | 41 final Uri fileUri; |
42 | 42 |
43 final String relativeFileUri; | 43 final String relativeFileUri; |
44 | 44 |
45 LibraryBuilder partOfLibrary; | 45 LibraryBuilder partOfLibrary; |
46 | 46 |
47 /// True if a compile-time error has been reported in this library. | 47 /// True if a compile-time error has been reported in this library. |
48 bool hasCompileTimeErrors = false; | 48 bool hasCompileTimeErrors = false; |
49 | 49 |
50 bool mayImplementRestrictedTypes = false; | |
51 | |
52 LibraryBuilder(Uri fileUri, this.scope, this.exports) | 50 LibraryBuilder(Uri fileUri, this.scope, this.exports) |
53 : fileUri = fileUri, | 51 : fileUri = fileUri, |
54 relativeFileUri = relativizeUri(fileUri), | 52 relativeFileUri = relativizeUri(fileUri), |
55 scopeBuilder = new ScopeBuilder(scope), | 53 scopeBuilder = new ScopeBuilder(scope), |
56 exportScopeBuilder = new ScopeBuilder(exports), | 54 exportScopeBuilder = new ScopeBuilder(exports), |
57 super(null, -1, fileUri); | 55 super(null, -1, fileUri); |
58 | 56 |
59 Loader get loader; | 57 Loader get loader; |
60 | 58 |
61 Uri get uri; | 59 Uri get uri; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 /// Don't use for scope lookup. Only use when an element is known to exist | 176 /// Don't use for scope lookup. Only use when an element is known to exist |
179 /// (and not a setter). | 177 /// (and not a setter). |
180 Builder operator [](String name) { | 178 Builder operator [](String name) { |
181 return scope.local[name] ?? internalError("Not found: '$name'."); | 179 return scope.local[name] ?? internalError("Not found: '$name'."); |
182 } | 180 } |
183 | 181 |
184 Builder lookup(String name, int charOffset, Uri fileUri) { | 182 Builder lookup(String name, int charOffset, Uri fileUri) { |
185 return scope.lookup(name, charOffset, fileUri); | 183 return scope.lookup(name, charOffset, fileUri); |
186 } | 184 } |
187 } | 185 } |
OLD | NEW |