| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 elements; | 5 library elements; |
| 6 | 6 |
| 7 | 7 |
| 8 import 'modelx.dart'; | 8 import 'modelx.dart'; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 void addMetadata(MetadataAnnotation annotation); | 246 void addMetadata(MetadataAnnotation annotation); |
| 247 void setNative(String name); | 247 void setNative(String name); |
| 248 void setFixedBackendName(String name); | 248 void setFixedBackendName(String name); |
| 249 | 249 |
| 250 Scope buildScope(); | 250 Scope buildScope(); |
| 251 | 251 |
| 252 /// If the element is a forwarding constructor, [targetConstructor] holds | 252 /// If the element is a forwarding constructor, [targetConstructor] holds |
| 253 /// the generative constructor that the forwarding constructor points to | 253 /// the generative constructor that the forwarding constructor points to |
| 254 /// (possibly via other forwarding constructors). | 254 /// (possibly via other forwarding constructors). |
| 255 FunctionElement get targetConstructor; | 255 FunctionElement get targetConstructor; |
| 256 |
| 257 void diagnose(Element context, DiagnosticListener listener) {} |
| 256 } | 258 } |
| 257 | 259 |
| 258 class Elements { | 260 class Elements { |
| 259 static bool isUnresolved(Element e) { | 261 static bool isUnresolved(Element e) { |
| 260 return e == null || e.isErroneous(); | 262 return e == null || e.isErroneous(); |
| 261 } | 263 } |
| 262 static bool isErroneousElement(Element e) => e != null && e.isErroneous(); | 264 static bool isErroneousElement(Element e) => e != null && e.isErroneous(); |
| 263 | 265 |
| 264 static bool isClass(Element e) => e != null && e.kind == ElementKind.CLASS; | 266 static bool isClass(Element e) => e != null && e.kind == ElementKind.CLASS; |
| 265 static bool isTypedef(Element e) { | 267 static bool isTypedef(Element e) { |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 bool get exportsHandled; | 621 bool get exportsHandled; |
| 620 | 622 |
| 621 // TODO(kasperl): We should try to get rid of these. | 623 // TODO(kasperl): We should try to get rid of these. |
| 622 void set canUseNative(bool value); | 624 void set canUseNative(bool value); |
| 623 void set libraryTag(LibraryName value); | 625 void set libraryTag(LibraryName value); |
| 624 | 626 |
| 625 LibraryElement get implementation; | 627 LibraryElement get implementation; |
| 626 | 628 |
| 627 void addCompilationUnit(CompilationUnitElement element); | 629 void addCompilationUnit(CompilationUnitElement element); |
| 628 void addTag(LibraryTag tag, DiagnosticListener listener); | 630 void addTag(LibraryTag tag, DiagnosticListener listener); |
| 629 void addImport(Element element, DiagnosticListener listener); | 631 void addImport(Element element, Import import, DiagnosticListener listener); |
| 630 | 632 |
| 631 /// Record which element an import or export tag resolved to. | 633 /// Record which element an import or export tag resolved to. |
| 632 /// (Belongs on builder object). | 634 /// (Belongs on builder object). |
| 633 void recordResolvedTag(LibraryDependency tag, LibraryElement library); | 635 void recordResolvedTag(LibraryDependency tag, LibraryElement library); |
| 634 | 636 |
| 635 /// Return the library element corresponding to an import or export. | 637 /// Return the library element corresponding to an import or export. |
| 636 LibraryElement getLibraryFromTag(LibraryDependency tag); | 638 LibraryElement getLibraryFromTag(LibraryDependency tag); |
| 637 | 639 |
| 638 void addMember(Element element, DiagnosticListener listener); | 640 void addMember(Element element, DiagnosticListener listener); |
| 639 void addToScope(Element element, DiagnosticListener listener); | 641 void addToScope(Element element, DiagnosticListener listener); |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 int get resolutionState; | 914 int get resolutionState; |
| 913 Token get beginToken; | 915 Token get beginToken; |
| 914 Token get endToken; | 916 Token get endToken; |
| 915 | 917 |
| 916 // TODO(kasperl): Try to get rid of these. | 918 // TODO(kasperl): Try to get rid of these. |
| 917 void set annotatedElement(Element value); | 919 void set annotatedElement(Element value); |
| 918 void set resolutionState(int value); | 920 void set resolutionState(int value); |
| 919 | 921 |
| 920 MetadataAnnotation ensureResolved(Compiler compiler); | 922 MetadataAnnotation ensureResolved(Compiler compiler); |
| 921 } | 923 } |
| OLD | NEW |