code format, expanded dependency constraint on unittest,
removed unused variable
fixed homepage URL
R=nweiz@google.com
Review URL: https://codereview.chromium.org//1045533002
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9c03874..ce1e012 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.1.3+1
+
+* Fixed the homepage URL.
+
## 0.1.3
* Add an optional `endState` argument to `SpanScanner.spanFrom`.
diff --git a/lib/src/line_scanner.dart b/lib/src/line_scanner.dart
index 4e12173..54ecf7b 100644
--- a/lib/src/line_scanner.dart
+++ b/lib/src/line_scanner.dart
@@ -40,8 +40,8 @@
super.position = newPosition;
if (newPosition > oldPosition) {
- var newlines = "\n".allMatches(string.substring(oldPosition, newPosition))
- .toList();
+ var newlines =
+ "\n".allMatches(string.substring(oldPosition, newPosition)).toList();
_line += newlines.length;
if (newlines.isEmpty) {
_column += newPosition - oldPosition;
@@ -49,8 +49,8 @@
_column = newPosition - newlines.last.end;
}
} else {
- var newlines = "\n".allMatches(string.substring(newPosition, oldPosition))
- .toList();
+ var newlines =
+ "\n".allMatches(string.substring(newPosition, oldPosition)).toList();
_line -= newlines.length;
if (newlines.isEmpty) {
_column -= oldPosition - newPosition;
@@ -75,7 +75,6 @@
}
bool scan(Pattern pattern) {
- var oldPosition = position;
if (!super.scan(pattern)) return false;
var newlines = "\n".allMatches(lastMatch[0]).toList();
diff --git a/lib/src/string_scanner.dart b/lib/src/string_scanner.dart
index bc5e1f5..d9c1c2f 100644
--- a/lib/src/string_scanner.dart
+++ b/lib/src/string_scanner.dart
@@ -107,8 +107,8 @@
if (!_slashAutoEscape) source = source.replaceAll("/", "\\/");
name = "/$source/";
} else {
- name = pattern.toString()
- .replaceAll("\\", "\\\\").replaceAll('"', '\\"');
+ name =
+ pattern.toString().replaceAll("\\", "\\\\").replaceAll('"', '\\"');
name = '"$name"';
}
}
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index e556236..107c4c5 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -27,4 +27,4 @@
throw new RangeError("position plus length must not go beyond the end of "
"the string.");
}
-}
\ No newline at end of file
+}
diff --git a/pubspec.yaml b/pubspec.yaml
index 2a712b8..ffd4ccc 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,13 +1,13 @@
name: string_scanner
-version: 0.1.3
+version: 0.1.3+1
author: "Dart Team <misc@dartlang.org>"
-homepage: http://github.com/dart-lang/string_scanner
+homepage: https://github.com/dart-lang/string_scanner
description: >
A class for parsing strings using a sequence of patterns.
dependencies:
path: ">=1.2.0 <2.0.0"
source_span: ">=1.0.0 <2.0.0"
dev_dependencies:
- unittest: ">=0.10.0 <0.11.0"
+ unittest: ">=0.10.0 <0.12.0"
environment:
sdk: ">=1.2.0 <2.0.0"
diff --git a/test/error_test.dart b/test/error_test.dart
index 4fe9083..d7b81e8 100644
--- a/test/error_test.dart
+++ b/test/error_test.dart
@@ -28,7 +28,8 @@
});
test('supports a match on a previous line', () {
- var scanner = new StringScanner('foo bar baz\ndo re mi\nearth fire water');
+ var scanner =
+ new StringScanner('foo bar baz\ndo re mi\nearth fire water');
scanner.expect('foo bar baz\ndo ');
scanner.expect('re');
var match = scanner.lastMatch;
@@ -38,7 +39,8 @@
});
test('supports a multiline match', () {
- var scanner = new StringScanner('foo bar baz\ndo re mi\nearth fire water');
+ var scanner =
+ new StringScanner('foo bar baz\ndo re mi\nearth fire water');
scanner.expect('foo bar ');
scanner.expect('baz\ndo');
var match = scanner.lastMatch;
@@ -81,14 +83,16 @@
});
test('supports a position on a previous line', () {
- var scanner = new StringScanner('foo bar baz\ndo re mi\nearth fire water');
+ var scanner =
+ new StringScanner('foo bar baz\ndo re mi\nearth fire water');
scanner.expect('foo bar baz\ndo re mi\nearth');
expect(() => scanner.error('oh no!', position: 15, length: 2),
throwsStringScannerException('re'));
});
test('supports a multiline length', () {
- var scanner = new StringScanner('foo bar baz\ndo re mi\nearth fire water');
+ var scanner =
+ new StringScanner('foo bar baz\ndo re mi\nearth fire water');
scanner.expect('foo bar baz\ndo re mi\nearth');
expect(() => scanner.error('oh no!', position: 8, length: 8),
throwsStringScannerException('baz\ndo r'));
@@ -121,8 +125,7 @@
});
test("if match is passed with length", () {
- expect(
- () => scanner.error("oh no!", match: scanner.lastMatch, length: 1),
+ expect(() => scanner.error("oh no!", match: scanner.lastMatch, length: 1),
throwsArgumentError);
});
diff --git a/test/string_scanner_test.dart b/test/string_scanner_test.dart
index fcd904a..7b00796 100644
--- a/test/string_scanner_test.dart
+++ b/test/string_scanner_test.dart
@@ -330,8 +330,8 @@
});
test('throws an ArgumentError if the position is beyond the string', () {
- expect(() => new StringScanner('foo bar', position: 8),
- throwsArgumentError);
+ expect(
+ () => new StringScanner('foo bar', position: 8), throwsArgumentError);
});
});
}