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

Unified Diff: pkg/barback/lib/src/span_wrapper.dart

Issue 423823010: Support source_span spans in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 5 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/barback/CHANGELOG.md ('k') | pkg/barback/lib/src/transformer/transform_logger.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/span_wrapper.dart
diff --git a/pkg/source_maps/lib/src/span_wrapper.dart b/pkg/barback/lib/src/span_wrapper.dart
similarity index 52%
copy from pkg/source_maps/lib/src/span_wrapper.dart
copy to pkg/barback/lib/src/span_wrapper.dart
index e0c107bf74554a738a0d9a3c6baa5387b8b6eab6..4b637123941c1441da54384b7e5aef66c147c23b 100644
--- a/pkg/source_maps/lib/src/span_wrapper.dart
+++ b/pkg/barback/lib/src/span_wrapper.dart
@@ -4,10 +4,9 @@
library source_maps.span_wrapper;
+import 'package:source_maps/source_maps.dart';
import 'package:source_span/source_span.dart' as source_span;
-import '../span.dart';
-
/// A wrapper that exposes a [source_span.SourceSpan] as a [Span].
class SpanWrapper extends Span {
final source_span.SourceSpan _inner;
@@ -44,42 +43,3 @@ class LocationWrapper extends Location {
return new LocationWrapper(location);
}
}
-
-/// A wrapper that exposes a [source_span.SourceFile] as a [SourceFile].
-class SourceFileWrapper implements SourceFile {
- final source_span.SourceFile _inner;
-
- // These are necessary to avoid analyzer warnings;
- final _lineStarts = null;
- final _decodedChars = null;
-
- String get url => _inner.url.toString();
-
- SourceFileWrapper(this._inner);
-
- static SourceFile wrap(sourceFile) {
- if (sourceFile is SourceFile) return sourceFile;
- return new SourceFileWrapper(sourceFile);
- }
-
- Span span(int start, [int end, bool isIdentifier = false]) {
- if (end == null) end = start;
- return new SpanWrapper(_inner.span(start, end), isIdentifier);
- }
-
- Location location(int offset) => new LocationWrapper(_inner.location(offset));
-
- int getLine(int offset) => _inner.getLine(offset);
-
- int getColumn(int line, int offset) => _inner.getColumn(offset, line: line);
-
- int getOffset(int line, int column) => _inner.getOffset(line, column);
-
- String getText(int start, [int end]) => _inner.getText(start, end);
-
- String getLocationMessage(String message, int start, int end,
- {bool useColors: false, String color}) {
- return span(start, end).getLocationMessage(message,
- useColors: useColors, color: color);
- }
-}
« no previous file with comments | « pkg/barback/CHANGELOG.md ('k') | pkg/barback/lib/src/transformer/transform_logger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698