Package com.google.dart.engine.internal.resolver

Examples of com.google.dart.engine.internal.resolver.LibraryResolver2


   * @return an entry containing the computed results
   * @throws AnalysisException if the results could not be recorded
   */
  protected DartEntry recordResolveDartLibraryCycleTaskResults(ResolveDartLibraryCycleTask task)
      throws AnalysisException {
    LibraryResolver2 resolver = task.getLibraryResolver();
    AnalysisException thrownException = task.getException();
    DartEntry unitEntry = null;
    Source unitSource = task.getUnitSource();
    if (resolver != null) {
      //
      // The resolver should only be null if an exception was thrown before (or while) it was
      // being created.
      //
      List<ResolvableLibrary> resolvedLibraries = resolver.getResolvedLibraries();
      synchronized (cacheLock) {
        if (resolvedLibraries == null) {
          //
          // The resolved libraries should only be null if an exception was thrown during resolution.
          //
          unitEntry = getReadableDartEntry(unitSource);
          if (unitEntry == null) {
            throw new AnalysisException("A Dart file became a non-Dart file: "
                + unitSource.getFullName());
          }
          DartEntryImpl dartCopy = unitEntry.getWritableCopy();
          if (thrownException == null) {
            dartCopy.recordResolutionError(new AnalysisException(
                "In recordResolveDartLibraryCycleTaskResults, resolvedLibraries was null and there was no thrown exception"));
          } else {
            dartCopy.recordResolutionError(thrownException);
          }
          cache.put(unitSource, dartCopy);
          cache.remove(unitSource);
          if (thrownException != null) {
            throw thrownException;
          }
          return dartCopy;
        }
        if (allModificationTimesMatch(resolvedLibraries)) {
          Source htmlSource = getSourceFactory().forUri(DartSdk.DART_HTML);
          RecordingErrorListener errorListener = resolver.getErrorListener();
          for (ResolvableLibrary library : resolvedLibraries) {
            Source librarySource = library.getLibrarySource();
            for (Source source : library.getCompilationUnitSources()) {
              CompilationUnit unit = library.getAST(source);
              AnalysisError[] errors = errorListener.getErrorsForSource(source);
View Full Code Here


    return "resolve library " + librarySource.getFullName();
  }

  @Override
  protected void internalPerform() throws AnalysisException {
    resolver = new LibraryResolver2(getContext());
    resolver.resolveLibrary(librarySource, librariesInCycle);
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.internal.resolver.LibraryResolver2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.