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 library compiler; | 5 library compiler; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection' show SplayTreeMap; | 8 import 'dart:collection' show SplayTreeMap; |
9 import 'dart:json' as json; | 9 import 'dart:json' as json; |
10 import 'package:analyzer_experimental/src/generated/ast.dart' show Directive, Ur iBasedDirective; | 10 import 'package:analyzer_experimental/src/generated/ast.dart' show Directive, Ur iBasedDirective; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 | 100 |
101 /** Compile the application starting from the given [mainFile]. */ | 101 /** Compile the application starting from the given [mainFile]. */ |
102 Future run() { | 102 Future run() { |
103 if (path.basename(_mainPath).endsWith('.dart')) { | 103 if (path.basename(_mainPath).endsWith('.dart')) { |
104 _messages.error("Please provide an HTML file as your entry point.", | 104 _messages.error("Please provide an HTML file as your entry point.", |
105 null, file: _mainPath); | 105 null, file: _mainPath); |
106 return new Future.immediate(null); | 106 return new Future.immediate(null); |
107 } | 107 } |
108 return _parseAndDiscover(_mainPath).then((_) { | 108 return _parseAndDiscover(_mainPath).then((_) { |
109 _analyze(); | 109 _analyze(); |
110 if (_messages.hasErrors) return; | |
110 _transformDart(); | 111 _transformDart(); |
112 if (_messages.hasErrors) return; | |
Jennifer Messerly
2013/03/19 23:36:04
this should clear outputs like the other if below.
Siggi Cherem (dart-lang)
2013/03/19 23:44:53
Done (see below)
| |
111 _emit(); | 113 _emit(); |
112 // TODO(jmesserly): need to go through our errors, and figure out if some | 114 // TODO(jmesserly): need to go through our errors, and figure out if some |
113 // of them should be warnings instead. | 115 // of them should be warnings instead. |
114 if (_messages.hasErrors) output.clear(); | 116 if (_messages.hasErrors) output.clear(); |
Jennifer Messerly
2013/03/19 23:36:04
Do we actually emit errors from emit anymore? I be
Siggi Cherem (dart-lang)
2013/03/19 23:44:53
Now that I think about it, _transformDart can't pr
Jennifer Messerly
2013/03/19 23:46:44
We might eventually get them from the analyzer. Bu
| |
115 }); | 117 }); |
116 } | 118 } |
117 | 119 |
118 /** | 120 /** |
119 * Asynchronously parse [inputFile] and transitively discover web components | 121 * Asynchronously parse [inputFile] and transitively discover web components |
120 * to load and parse. Returns a future that completes when all files are | 122 * to load and parse. Returns a future that completes when all files are |
121 * processed. | 123 * processed. |
122 */ | 124 */ |
123 Future _parseAndDiscover(String inputFile) { | 125 Future _parseAndDiscover(String inputFile) { |
124 _tasks = new FutureGroup(); | 126 _tasks = new FutureGroup(); |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
725 component.declaringFile.inputPath, messages, options); | 727 component.declaringFile.inputPath, messages, options); |
726 if (styleSheet != null) { | 728 if (styleSheet != null) { |
727 component.styleSheets.add(styleSheet); | 729 component.styleSheets.add(styleSheet); |
728 } | 730 } |
729 } | 731 } |
730 } | 732 } |
731 | 733 |
732 super.visitElementInfo(info); | 734 super.visitElementInfo(info); |
733 } | 735 } |
734 } | 736 } |
OLD | NEW |