| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 package com.google.dart.compiler; | 5 package com.google.dart.compiler; |
| 6 | 6 |
| 7 import com.google.common.collect.Lists; | 7 import com.google.common.collect.Lists; |
| 8 import com.google.common.collect.Sets; | 8 import com.google.common.collect.Sets; |
| 9 import com.google.common.collect.Sets.SetView; | 9 import com.google.common.collect.Sets.SetView; |
| 10 import com.google.common.io.CharStreams; | 10 import com.google.common.io.CharStreams; |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 LibraryDeps deps = lib.getDeps(context); | 512 LibraryDeps deps = lib.getDeps(context); |
| 513 | 513 |
| 514 // Prepare all top-level symbols. | 514 // Prepare all top-level symbols. |
| 515 Set<String> oldTopLevelSymbols = Sets.newHashSet(); | 515 Set<String> oldTopLevelSymbols = Sets.newHashSet(); |
| 516 for (LibraryDeps.Source source : deps.getSources()) { | 516 for (LibraryDeps.Source source : deps.getSources()) { |
| 517 oldTopLevelSymbols.addAll(source.getTopSymbols()); | 517 oldTopLevelSymbols.addAll(source.getTopSymbols()); |
| 518 } | 518 } |
| 519 | 519 |
| 520 // Parse units that are out-of-date with respect to their dependencies
. | 520 // Parse units that are out-of-date with respect to their dependencies
. |
| 521 for (DartUnit unit : lib.getUnits()) { | 521 for (DartUnit unit : lib.getUnits()) { |
| 522 String relPath = unit.getSource().getRelativePath(); | 522 if (unit.isDiet()) { |
| 523 LibraryDeps.Source source = deps.getSource(relPath); | 523 String relPath = unit.getSource().getRelativePath(); |
| 524 if (isUnitOutOfDate(lib, source)) { | 524 LibraryDeps.Source source = deps.getSource(relPath); |
| 525 filesHaveChanged = true; | 525 if (isUnitOutOfDate(lib, source)) { |
| 526 DartSource dartSrc = lib.getSource().getSourceFor(relPath); | 526 filesHaveChanged = true; |
| 527 if (dartSrc != null && dartSrc.exists()) { | 527 DartSource dartSrc = lib.getSource().getSourceFor(relPath); |
| 528 unit = parse(dartSrc, lib.getPrefixes(), false); | 528 if (dartSrc != null && dartSrc.exists()) { |
| 529 if (unit != null) { | 529 unit = parse(dartSrc, lib.getPrefixes(), false); |
| 530 lib.putUnit(unit); | 530 if (unit != null) { |
| 531 lib.putUnit(unit); |
| 532 } |
| 531 } | 533 } |
| 532 } | 534 } |
| 533 } | 535 } |
| 534 } | 536 } |
| 535 } | 537 } |
| 536 | 538 |
| 537 if (filesHaveChanged) { | 539 if (filesHaveChanged) { |
| 538 context.setFilesHaveChanged(); | 540 context.setFilesHaveChanged(); |
| 539 } | 541 } |
| 540 } finally { | 542 } finally { |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 return unit; | 1306 return unit; |
| 1305 } | 1307 } |
| 1306 } | 1308 } |
| 1307 return null; | 1309 return null; |
| 1308 } | 1310 } |
| 1309 | 1311 |
| 1310 public static LibraryUnit getCoreLib(LibraryUnit libraryUnit) { | 1312 public static LibraryUnit getCoreLib(LibraryUnit libraryUnit) { |
| 1311 return findLibrary(libraryUnit, "corelib.dart", new HashSet<LibraryElement>(
)); | 1313 return findLibrary(libraryUnit, "corelib.dart", new HashSet<LibraryElement>(
)); |
| 1312 } | 1314 } |
| 1313 } | 1315 } |
| OLD | NEW |