Examples of DartEntry


Examples of com.google.dart.engine.internal.cache.DartEntry

      Source librarySource = entry.getKey();
      Source[] oldParts = entry.getValue();
      for (int i = 0; i < oldParts.length; i++) {
        Source partSource = oldParts[i];
        if (!partSource.equals(librarySource)) {
          DartEntry partEntry = getReadableDartEntry(partSource);
          if (partEntry != null) {
            DartEntryImpl partCopy = partEntry.getWritableCopy();
            partCopy.removeContainingLibrary(librarySource);
            if (partCopy.getContainingLibraries().size() == 0 && !exists(partSource)) {
              cache.remove(partSource);
            } else {
              cache.put(partSource, partCopy);
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

        int count = sourcesToInvalidate.size();
        for (int i = 0; i < count; i++) {
          Source source = sourcesToInvalidate.get(i);
          SourceEntry entry = getReadableSourceEntry(source);
          if (entry instanceof DartEntry) {
            DartEntry dartEntry = (DartEntry) entry;
            DartEntryImpl dartCopy = dartEntry.getWritableCopy();
            dartCopy.invalidateAllResolutionInformation(false);
            cache.put(source, dartCopy);
            workManager.add(source, computePriority(dartCopy));
          } else if (entry instanceof HtmlEntry) {
            HtmlEntry htmlEntry = (HtmlEntry) entry;
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

    boolean enableHints = options.getHint();
    SourceEntry sourceEntry = getReadableSourceEntry(source);
    if (sourceEntry instanceof DartEntry) {
      ArrayList<AnalysisError> errors = new ArrayList<AnalysisError>();
      try {
        DartEntry dartEntry = (DartEntry) sourceEntry;
        ListUtilities.addAll(errors, getDartScanData(source, dartEntry, DartEntry.SCAN_ERRORS));
        dartEntry = getReadableDartEntry(source);
        ListUtilities.addAll(errors, getDartParseData(source, dartEntry, DartEntry.PARSE_ERRORS));
        dartEntry = getReadableDartEntry(source);
        if (dartEntry.getValue(DartEntry.SOURCE_KIND) == SourceKind.LIBRARY) {
          ListUtilities.addAll(
              errors,
              getDartResolutionData(source, source, dartEntry, DartEntry.RESOLUTION_ERRORS));
          dartEntry = getReadableDartEntry(source);
          ListUtilities.addAll(
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

  @Override
  public ResolvableCompilationUnit computeResolvableCompilationUnit(Source source)
      throws AnalysisException {
    synchronized (cacheLock) {
      DartEntry dartEntry = getReadableDartEntry(source);
      if (dartEntry == null) {
        throw new AnalysisException("computeResolvableCompilationUnit for non-Dart: "
            + source.getFullName());
      }
      dartEntry = cacheDartParseData(source, dartEntry, DartEntry.PARSED_UNIT);
      DartEntryImpl dartCopy = dartEntry.getWritableCopy();
      CompilationUnit unit = dartCopy.getResolvableCompilationUnit();
      if (unit == null) {
        throw new AnalysisException(
            "Internal error: computeResolvableCompilationUnit could not parse "
                + source.getFullName(),
            dartEntry.getException());
      }
      cache.put(source, dartCopy);
      return new ResolvableCompilationUnit(dartCopy.getModificationTime(), unit);
    }
  }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

  @Override
  public AnalysisErrorInfo getErrors(Source source) {
    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
    if (sourceEntry instanceof DartEntry) {
      DartEntry dartEntry = (DartEntry) sourceEntry;
      return new AnalysisErrorInfoImpl(
          dartEntry.getAllErrors(),
          dartEntry.getValue(SourceEntry.LINE_INFO));
    } else if (sourceEntry instanceof HtmlEntry) {
      HtmlEntry htmlEntry = (HtmlEntry) sourceEntry;
      return new AnalysisErrorInfoImpl(
          htmlEntry.getAllErrors(),
          htmlEntry.getValue(SourceEntry.LINE_INFO));
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

  @Override
  public Namespace getPublicNamespace(LibraryElement library) {
    // TODO(brianwilkerson) Rename this to not start with 'get'. Note that this is not part of the
    // API of the interface.
    Source source = library.getDefiningCompilationUnit().getSource();
    DartEntry dartEntry = getReadableDartEntry(source);
    if (dartEntry == null) {
      return null;
    }
    Namespace namespace = null;
    if (dartEntry.getValue(DartEntry.ELEMENT) == library) {
      namespace = dartEntry.getValue(DartEntry.PUBLIC_NAMESPACE);
    }
    if (namespace == null) {
      NamespaceBuilder builder = new NamespaceBuilder();
      namespace = builder.createPublicNamespaceForLibrary(library);
      synchronized (cacheLock) {
        dartEntry = getReadableDartEntry(source);
        if (dartEntry == null) {
          AnalysisEngine.getInstance().getLogger().logError(
              "Could not compute the public namespace for " + library.getSource().getFullName(),
              new AnalysisException("A Dart file became a non-Dart file: " + source.getFullName()));
          return null;
        }
        if (dartEntry.getValue(DartEntry.ELEMENT) == library) {
          DartEntryImpl dartCopy = getReadableDartEntry(source).getWritableCopy();
          dartCopy.setValue(DartEntry.PUBLIC_NAMESPACE, namespace);
          cache.put(source, dartCopy);
        }
      }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

      MapIterator<Source, SourceEntry> iterator = cache.iterator();
      while (iterator.moveNext()) {
        SourceEntry sourceEntry = iterator.getValue();
        if (sourceEntry instanceof DartEntry) {
          Source source = iterator.getKey();
          DartEntry dartEntry = (DartEntry) sourceEntry;
          SourceKind kind = dartEntry.getValue(DartEntry.SOURCE_KIND);
          // get library independent values
          statistics.putCacheItem(dartEntry, SourceEntry.LINE_INFO);
          statistics.putCacheItem(dartEntry, DartEntry.PARSE_ERRORS);
          statistics.putCacheItem(dartEntry, DartEntry.PARSED_UNIT);
          statistics.putCacheItem(dartEntry, DartEntry.SOURCE_KIND);
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

  @Override
  public boolean isClientLibrary(Source librarySource) {
    SourceEntry sourceEntry = getReadableSourceEntry(librarySource);
    if (sourceEntry instanceof DartEntry) {
      DartEntry dartEntry = (DartEntry) sourceEntry;
      return dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
    }
    return false;
  }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

  @Override
  public boolean isServerLibrary(Source librarySource) {
    SourceEntry sourceEntry = getReadableSourceEntry(librarySource);
    if (sourceEntry instanceof DartEntry) {
      DartEntry dartEntry = (DartEntry) sourceEntry;
      return !dartEntry.getValue(DartEntry.IS_CLIENT)
          && dartEntry.getValue(DartEntry.IS_LAUNCHABLE);
    }
    return false;
  }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.DartEntry

        Source librarySource = entry.getKey();
        LibraryElement library = entry.getValue();
        //
        // Cache the element in the library's info.
        //
        DartEntry dartEntry = getReadableDartEntry(librarySource);
        if (dartEntry != null) {
          DartEntryImpl dartCopy = dartEntry.getWritableCopy();
          recordElementData(dartCopy, library, library.getSource(), htmlSource);
          dartCopy.setState(SourceEntry.CONTENT, CacheState.FLUSHED);
          dartCopy.setValue(SourceEntry.LINE_INFO, new LineInfo(new int[] {0}));
          dartCopy.setValue(DartEntry.ANGULAR_ERRORS, AnalysisError.NO_ERRORS);
          // DartEntry.ELEMENT - set in recordElementData
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.