OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library engine.task.dart; | 5 library engine.task.dart; |
6 | 6 |
7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
10 import 'package:analyzer/src/generated/resolver.dart'; | 10 import 'package:analyzer/src/generated/resolver.dart'; |
(...skipping 22 matching lines...) Expand all Loading... |
33 /** | 33 /** |
34 * The element model that was built. | 34 * The element model that was built. |
35 */ | 35 */ |
36 CompilationUnitElement unitElement; | 36 CompilationUnitElement unitElement; |
37 | 37 |
38 /** | 38 /** |
39 * Initialize a newly created task to build a compilation unit element for | 39 * Initialize a newly created task to build a compilation unit element for |
40 * the given [source] in the given [library] based on the compilation [unit] | 40 * the given [source] in the given [library] based on the compilation [unit] |
41 * that was parsed. | 41 * that was parsed. |
42 */ | 42 */ |
43 BuildUnitElementTask(InternalAnalysisContext context, this.source, this.librar
y, this.unit) | 43 BuildUnitElementTask(InternalAnalysisContext context, this.source, |
| 44 this.library, this.unit) |
44 : super(context); | 45 : super(context); |
45 | 46 |
46 @override | 47 @override |
| 48 String get taskDescription { |
| 49 if (source == null) { |
| 50 return "build the unit element model for null source"; |
| 51 } |
| 52 return "build the unit element model for " + source.fullName; |
| 53 } |
| 54 |
| 55 @override |
47 accept(AnalysisTaskVisitor visitor) { | 56 accept(AnalysisTaskVisitor visitor) { |
48 return visitor.visitBuildUnitElementTask(this); | 57 return visitor.visitBuildUnitElementTask(this); |
49 } | 58 } |
50 | 59 |
51 /** | 60 /** |
52 * Return the compilation unit from which the element model was built. | 61 * Return the compilation unit from which the element model was built. |
53 */ | 62 */ |
54 CompilationUnit getCompilationUnit() { | 63 CompilationUnit getCompilationUnit() { |
55 return unit; | 64 return unit; |
56 } | 65 } |
(...skipping 11 matching lines...) Expand all Loading... |
68 */ | 77 */ |
69 CompilationUnitElement getUnitElement() { | 78 CompilationUnitElement getUnitElement() { |
70 return unitElement; | 79 return unitElement; |
71 } | 80 } |
72 | 81 |
73 @override | 82 @override |
74 void internalPerform() { | 83 void internalPerform() { |
75 CompilationUnitBuilder builder = new CompilationUnitBuilder(); | 84 CompilationUnitBuilder builder = new CompilationUnitBuilder(); |
76 unitElement = builder.buildCompilationUnit(source, unit); | 85 unitElement = builder.buildCompilationUnit(source, unit); |
77 } | 86 } |
78 | |
79 @override | |
80 String get taskDescription { | |
81 if (source == null) { | |
82 return "build the unit element model for null source"; | |
83 } | |
84 return "build the unit element model for " + source.fullName; | |
85 } | |
86 } | 87 } |
OLD | NEW |