Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: pkg/compiler/lib/src/io/source_information.dart

Issue 917033002: Redo "Steps towards making dart2js JS AST templates an indepentent library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698