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

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

Issue 430973002: Only support the new 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/lib/src/log.dart ('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/barback/lib/src/span_wrapper.dart b/pkg/barback/lib/src/span_wrapper.dart
deleted file mode 100644
index 4b637123941c1441da54384b7e5aef66c147c23b..0000000000000000000000000000000000000000
--- a/pkg/barback/lib/src/span_wrapper.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library source_maps.span_wrapper;
-
-import 'package:source_maps/source_maps.dart';
-import 'package:source_span/source_span.dart' as source_span;
-
-/// A wrapper that exposes a [source_span.SourceSpan] as a [Span].
-class SpanWrapper extends Span {
- final source_span.SourceSpan _inner;
-
- String get text => _inner.text;
-
- SpanWrapper(source_span.SourceSpan inner, bool isIdentifier)
- : _inner = inner,
- super(
- new LocationWrapper(inner.start),
- new LocationWrapper(inner.end),
- isIdentifier);
-
- static Span wrap(span, [bool isIdentifier = false]) {
- if (span is Span) return span;
- return new SpanWrapper(span, isIdentifier);
- }
-}
-
-/// A wrapper that exposes a [source_span.SourceLocation] as a [Location].
-class LocationWrapper extends Location {
- final source_span.SourceLocation _inner;
-
- String get sourceUrl => _inner.sourceUrl.toString();
- int get line => _inner.line;
- int get column => _inner.column;
-
- LocationWrapper(source_span.SourceLocation inner)
- : _inner = inner,
- super(inner.offset);
-
- static Location wrap(location) {
- if (location is Location) return location;
- return new LocationWrapper(location);
- }
-}
« no previous file with comments | « pkg/barback/lib/src/log.dart ('k') | pkg/barback/lib/src/transformer/transform_logger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698