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 |
50 LibraryBuilder(Uri fileUri, this.scope, this.exports) | 52 LibraryBuilder(Uri fileUri, this.scope, this.exports) |
51 : fileUri = fileUri, | 53 : fileUri = fileUri, |
52 relativeFileUri = relativizeUri(fileUri), | 54 relativeFileUri = relativizeUri(fileUri), |
53 scopeBuilder = new ScopeBuilder(scope), | 55 scopeBuilder = new ScopeBuilder(scope), |
54 exportScopeBuilder = new ScopeBuilder(exports), | 56 exportScopeBuilder = new ScopeBuilder(exports), |
55 super(null, -1, fileUri); | 57 super(null, -1, fileUri); |
56 | 58 |
57 Loader get loader; | 59 Loader get loader; |
58 | 60 |
59 Uri get uri; | 61 Uri get uri; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 /// Don't use for scope lookup. Only use when an element is known to exist | 178 /// Don't use for scope lookup. Only use when an element is known to exist |
177 /// (and not a setter). | 179 /// (and not a setter). |
178 Builder operator [](String name) { | 180 Builder operator [](String name) { |
179 return scope.local[name] ?? internalError("Not found: '$name'."); | 181 return scope.local[name] ?? internalError("Not found: '$name'."); |
180 } | 182 } |
181 | 183 |
182 Builder lookup(String name, int charOffset, Uri fileUri) { | 184 Builder lookup(String name, int charOffset, Uri fileUri) { |
183 return scope.lookup(name, charOffset, fileUri); | 185 return scope.lookup(name, charOffset, fileUri); |
184 } | 186 } |
185 } | 187 } |
OLD | NEW |