OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Source information system that maps spans of Dart AST nodes to spans of | 5 /// Source information system that maps spans of Dart AST nodes to spans of |
6 /// JavaScript nodes. | 6 /// JavaScript nodes. |
7 | 7 |
8 library dart2js.source_information.start_end; | 8 library dart2js.source_information.start_end; |
9 | 9 |
10 import '../common.dart'; | 10 import '../common.dart'; |
11 import '../diagnostics/messages.dart' show MessageTemplate; | 11 import '../diagnostics/messages.dart' show MessageTemplate; |
12 import '../elements/elements.dart' show ResolvedAst, ResolvedAstKind; | 12 import '../elements/elements.dart' show ResolvedAst, ResolvedAstKind; |
13 import '../js/js.dart' as js; | 13 import '../js/js.dart' as js; |
14 import '../js/js_source_mapping.dart'; | 14 import '../js/js_source_mapping.dart'; |
15 import '../tokens/token.dart' show Token; | 15 import 'package:dart_scanner/dart_scanner.dart' show Token; |
16 import '../tree/tree.dart' show Node; | 16 import '../tree/tree.dart' show Node; |
17 import 'source_file.dart'; | 17 import 'source_file.dart'; |
18 import 'source_information.dart'; | 18 import 'source_information.dart'; |
19 | 19 |
20 /// Source information that contains start source position and optionally an | 20 /// Source information that contains start source position and optionally an |
21 /// end source position. | 21 /// end source position. |
22 class StartEndSourceInformation extends SourceInformation { | 22 class StartEndSourceInformation extends SourceInformation { |
23 @override | 23 @override |
24 final SourceLocation startPosition; | 24 final SourceLocation startPosition; |
25 | 25 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 @override | 214 @override |
215 SourceInformation buildIf(Node node) => buildGeneric(node); | 215 SourceInformation buildIf(Node node) => buildGeneric(node); |
216 | 216 |
217 @override | 217 @override |
218 SourceInformationBuilder forContext(ResolvedAst resolvedAst, | 218 SourceInformationBuilder forContext(ResolvedAst resolvedAst, |
219 {SourceInformation sourceInformation}) { | 219 {SourceInformation sourceInformation}) { |
220 return new StartEndSourceInformationBuilder(resolvedAst); | 220 return new StartEndSourceInformationBuilder(resolvedAst); |
221 } | 221 } |
222 } | 222 } |
OLD | NEW |