Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 10826053: Restore DartCompiler method to fix the build (TBR) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/DartCompiler.java
===================================================================
--- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 9991)
+++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
@@ -1188,6 +1188,51 @@
* Analyzes the given library and all its transitive dependencies.
*
* @param lib The library to be analyzed
+ * @param parsedUnits A collection of unresolved ASTs that should be used
+ * instead of parsing the associated source from storage. Intended for
+ * IDE use when modified buffers must be analyzed. AST nodes in the map may be
+ * ignored if not referenced by {@code lib}. (May be null.)
+ * @param config The compiler configuration (phases will not be used), but resolution and
+ * type-analysis will be invoked
+ * @param provider A mechanism for specifying where code should be generated
+ * @param listener An object notified when compilation errors occur
+ * @throws NullPointerException if any of the arguments except {@code parsedUnits}
+ * are {@code null}
+ * @throws IOException on IO errors, which are not logged
+ */
+ public static LibraryUnit analyzeLibrary(LibrarySource lib, final Map<URI, DartUnit> parsedUnits,
+ CompilerConfiguration config, DartArtifactProvider provider, DartCompilerListener listener)
+ throws IOException {
+ final SystemLibraryManager manager = config.getSystemLibraryManager();
+ final HashMap<URI, LibraryUnit> resolvedLibs = new HashMap<URI, LibraryUnit>();
+ SelectiveCache selectiveCache = new SelectiveCache() {
+ @Override
+ public Map<URI, LibraryUnit> getResolvedLibraries() {
+ return resolvedLibs;
+ }
+ @Override
+ public DartUnit getUnresolvedDartUnit(DartSource dartSrc) {
+ if (parsedUnits == null) {
+ return null;
+ }
+ URI srcUri = dartSrc.getUri();
+ DartUnit parsedUnit = parsedUnits.remove(srcUri);
+ if (parsedUnit != null) {
+ return parsedUnit;
+ }
+ URI fileUri = manager.resolveDartUri(srcUri);
+ return parsedUnits.remove(fileUri);
+ }
+ };
+ Map<URI, LibraryUnit> libraryUnit = analyzeLibraries(lib, selectiveCache, config,
+ provider, listener, false);
+ return libraryUnit != null ? libraryUnit.get(lib.getUri()) : null;
+ }
+
+ /**
+ * Analyzes the given library and all its transitive dependencies.
+ *
+ * @param lib The library to be analyzed
* @param selectiveCache Provides cached parse and resolution results
* during selective compilation (not <code>null</code>)
* @param config The compiler configuration (phases and backends
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698