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

Unified Diff: pkg/compiler/lib/src/io/source_map_builder.dart

Issue 893963005: Refactor handling of source map information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/io/source_information.dart ('k') | pkg/compiler/lib/src/js/js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/io/source_map_builder.dart
diff --git a/pkg/compiler/lib/src/io/source_map_builder.dart b/pkg/compiler/lib/src/io/source_map_builder.dart
index 117e298a8f41f7566500306541e7d44ec59895f4..ed546f2e521389568b2c97f316827a55605cf34e 100644
--- a/pkg/compiler/lib/src/io/source_map_builder.dart
+++ b/pkg/compiler/lib/src/io/source_map_builder.dart
@@ -5,10 +5,9 @@
library dart2js.source_map_builder;
import '../util/util.dart';
-import '../scanner/scannerlib.dart' show Token;
import '../util/uri_extras.dart' show relativize;
import 'line_column_provider.dart';
-import 'source_file.dart';
+import 'source_information.dart' show SourceFileLocation;
class SourceMapBuilder {
static const int VLQ_BASE_SHIFT = 5;
@@ -230,42 +229,3 @@ class SourceMapEntry {
SourceMapEntry(this.sourceLocation, this.targetOffset);
}
-
-abstract class SourceFileLocation {
- SourceFile sourceFile;
-
- SourceFileLocation(this.sourceFile) {
- assert(isValid());
- }
-
- int line;
-
- int get offset;
-
- String getSourceUrl() => sourceFile.filename;
-
- int getLine() {
- if (line == null) line = sourceFile.getLine(offset);
- return line;
- }
-
- int getColumn() => sourceFile.getColumn(getLine(), offset);
-
- String getSourceName();
-
- bool isValid() => offset < sourceFile.length;
-}
-
-class TokenSourceFileLocation extends SourceFileLocation {
- final Token token;
- final String name;
-
- TokenSourceFileLocation(SourceFile sourceFile, this.token, this.name)
- : super(sourceFile);
-
- int get offset => token.charOffset;
-
- String getSourceName() {
- return name;
- }
-}
« no previous file with comments | « pkg/compiler/lib/src/io/source_information.dart ('k') | pkg/compiler/lib/src/js/js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698