Chromium Code Reviews| 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 | 5 |
| 6 /** | 6 /** |
| 7 * If true, print a warning for each method that was resolved, but not | 7 * If true, print a warning for each method that was resolved, but not |
| 8 * compiled. | 8 * compiled. |
| 9 */ | 9 */ |
| 10 final bool REPORT_EXCESS_RESOLUTION = false; | 10 final bool REPORT_EXCESS_RESOLUTION = false; |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 assert(parser !== null); | 607 assert(parser !== null); |
| 608 Node tree = parser.parse(element); | 608 Node tree = parser.parse(element); |
| 609 validator.validate(tree); | 609 validator.validate(tree); |
| 610 unparseValidator.check(element); | 610 unparseValidator.check(element); |
| 611 elements = resolver.resolve(element); | 611 elements = resolver.resolve(element); |
| 612 checker.check(tree, elements); | 612 checker.check(tree, elements); |
| 613 return elements; | 613 return elements; |
| 614 } | 614 } |
| 615 | 615 |
| 616 TreeElements analyze(WorkItem work, Enqueuer world) { | 616 TreeElements analyze(WorkItem work, Enqueuer world) { |
| 617 if (work.isAnalyzed()) return work.resolutionTree; | 617 if (work.isAnalyzed()) { |
| 618 enqueuer.resolution.resolvedElements[work.element] = work.resolutionTree; | |
|
ahe
2012/06/22 10:31:22
I'm not liking this. Could you add a todo for me t
Søren Gjesse
2012/06/22 11:52:35
Done.
| |
| 619 return work.resolutionTree; | |
| 620 } | |
| 618 if (progress.elapsedInMs() > 500) { | 621 if (progress.elapsedInMs() > 500) { |
| 619 // TODO(ahe): Add structured diagnostics to the compiler API and | 622 // TODO(ahe): Add structured diagnostics to the compiler API and |
| 620 // use it to separate this from the --verbose option. | 623 // use it to separate this from the --verbose option. |
| 621 if (phase == PHASE_RESOLVING) { | 624 if (phase == PHASE_RESOLVING) { |
| 622 log('Resolved ${enqueuer.resolution.resolvedElements.length} ' | 625 log('Resolved ${enqueuer.resolution.resolvedElements.length} ' |
| 623 'elements.'); | 626 'elements.'); |
| 624 progress.reset(); | 627 progress.reset(); |
| 625 } | 628 } |
| 626 } | 629 } |
| 627 Element element = work.element; | 630 Element element = work.element; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 834 // invariant that endOffset > beginOffset, but for EOF the | 837 // invariant that endOffset > beginOffset, but for EOF the |
| 835 // charoffset of the next token may be [beginOffset]. This can | 838 // charoffset of the next token may be [beginOffset]. This can |
| 836 // also happen for synthetized tokens that are produced during | 839 // also happen for synthetized tokens that are produced during |
| 837 // error handling. | 840 // error handling. |
| 838 final endOffset = | 841 final endOffset = |
| 839 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1); | 842 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1); |
| 840 assert(endOffset > beginOffset); | 843 assert(endOffset > beginOffset); |
| 841 return f(beginOffset, endOffset); | 844 return f(beginOffset, endOffset); |
| 842 } | 845 } |
| 843 } | 846 } |
| OLD | NEW |