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

Unified Diff: lib/src/line_scanner.dart

Issue 1045533002: pkg/string_scanner: code format, expanded dependency constraint on unittest (Closed) Base URL: https://github.com/dart-lang/string_scanner.git@master
Patch Set: Created 5 years, 9 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 | « CHANGELOG.md ('k') | lib/src/string_scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/line_scanner.dart
diff --git a/lib/src/line_scanner.dart b/lib/src/line_scanner.dart
index 4e1217305bbf66237df323972cd4cd7c6b6b939a..54ecf7bf9e62215d7a7412a760a24fb1b5dae60d 100644
--- a/lib/src/line_scanner.dart
+++ b/lib/src/line_scanner.dart
@@ -40,8 +40,8 @@ class LineScanner extends StringScanner {
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 @@ class LineScanner extends StringScanner {
_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 @@ class LineScanner extends StringScanner {
}
bool scan(Pattern pattern) {
- var oldPosition = position;
if (!super.scan(pattern)) return false;
var newlines = "\n".allMatches(lastMatch[0]).toList();
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/string_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698