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

Unified Diff: pkg/string_scanner/lib/src/string_scanner.dart

Issue 401753002: Move a number of packages and some of pub over to using source_span. (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/string_scanner/lib/src/span_scanner.dart ('k') | pkg/string_scanner/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/string_scanner/lib/src/string_scanner.dart
diff --git a/pkg/string_scanner/lib/src/string_scanner.dart b/pkg/string_scanner/lib/src/string_scanner.dart
index c9e74594a6f5a7ee08f53e0c59adaba7e82c21c4..44d5d2d87efb2d7b037aebb5ef7ffb66252ce96f 100644
--- a/pkg/string_scanner/lib/src/string_scanner.dart
+++ b/pkg/string_scanner/lib/src/string_scanner.dart
@@ -4,7 +4,7 @@
library string_scanner.string_scanner;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
import 'exception.dart';
import 'utils.dart';
@@ -52,7 +52,7 @@ class StringScanner {
///
/// [position] defaults to 0, the beginning of the string. [sourceUrl] is the
/// URL of the source of the string being scanned, if available. It can be
- /// either a [String] or a [Uri].
+ /// a [String], a [Uri], or `null`.
StringScanner(this.string, {sourceUrl, int position})
: sourceUrl = sourceUrl is String ? Uri.parse(sourceUrl) : sourceUrl {
if (position != null) this.position = position;
@@ -153,10 +153,9 @@ class StringScanner {
}
if (length == null) length = match == null ? 1 : match.end - match.start;
- var url = sourceUrl == null ? null : sourceUrl.toString();
- var sourceFile = new SourceFile.text(url, string);
+ var sourceFile = new SourceFile(string, url: sourceUrl);
var span = sourceFile.span(position, position + length);
- throw new StringScannerException(message, string, sourceUrl, span);
+ throw new StringScannerException(message, span, string);
}
// TODO(nweiz): Make this handle long lines more gracefully.
« no previous file with comments | « pkg/string_scanner/lib/src/span_scanner.dart ('k') | pkg/string_scanner/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698