| 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 library dart2js.source_information; | 5 library dart2js.source_information; |
| 6 | 6 |
| 7 import '../dart2jslib.dart' show SourceSpan; | 7 import '../dart2jslib.dart' show SourceSpan; |
| 8 import '../elements/elements.dart' show AstElement; | 8 import '../elements/elements.dart' show AstElement; |
| 9 import '../scanner/scannerlib.dart' show Token; | 9 import '../scanner/scannerlib.dart' show Token; |
| 10 import '../tree/tree.dart' show Node; | 10 import '../tree/tree.dart' show Node; |
| 11 import '../js/js.dart' show JavaScriptNodeSourceInformation; |
| 11 import 'code_output.dart'; | 12 import 'code_output.dart'; |
| 12 import 'source_file.dart'; | 13 import 'source_file.dart'; |
| 13 | 14 |
| 14 /// Interface for passing source information, for instance for use in source | 15 /// Interface for passing source information, for instance for use in source |
| 15 /// maps, through the backend. | 16 /// maps, through the backend. |
| 16 abstract class SourceInformation { | 17 abstract class SourceInformation extends JavaScriptNodeSourceInformation { |
| 17 SourceSpan get sourceSpan; | 18 SourceSpan get sourceSpan; |
| 18 void beginMapping(CodeOutput output); | 19 void beginMapping(CodeOutput output); |
| 19 void endMapping(CodeOutput output); | 20 void endMapping(CodeOutput output); |
| 20 } | 21 } |
| 21 | 22 |
| 22 /// Source information that contains start source position and optionally an | 23 /// Source information that contains start source position and optionally an |
| 23 /// end source position. | 24 /// end source position. |
| 24 class StartEndSourceInformation implements SourceInformation { | 25 class StartEndSourceInformation implements SourceInformation { |
| 25 final SourceFileLocation startPosition; | 26 final SourceFileLocation startPosition; |
| 26 final SourceFileLocation endPosition; | 27 final SourceFileLocation endPosition; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 int get offset => token.charOffset; | 155 int get offset => token.charOffset; |
| 155 | 156 |
| 156 String getSourceName() { | 157 String getSourceName() { |
| 157 return name; | 158 return name; |
| 158 } | 159 } |
| 159 | 160 |
| 160 String toString() { | 161 String toString() { |
| 161 return '${super.toString()}:$name'; | 162 return '${super.toString()}:$name'; |
| 162 } | 163 } |
| 163 } | 164 } |
| OLD | NEW |