Skip to content

Commit

Permalink
Make code in readme consistent with example (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Oct 31, 2022
1 parent 10435a4 commit 4a5cbc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ num parseNumber(String source) {
// [Scanner.lastMatch] holds the [MatchData] for the most recent call to
// [Scanner.scan], [Scanner.expect], or [Scanner.matches].
var number = num.parse(scanner.lastMatch[0]);
var number = num.parse(scanner.lastMatch![0]!);
if (scanner.scan('.')) {
scanner.expect(RegExp(r'\d+'));
final decimal = scanner.lastMatch[0];
final decimal = scanner.lastMatch![0]!;
number += int.parse(decimal) / math.pow(10, decimal.length);
}
Expand Down
2 changes: 1 addition & 1 deletion example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ num parseNumber(String source) {

// [Scanner.lastMatch] holds the [MatchData] for the most recent call to
// [Scanner.scan], [Scanner.expect], or [Scanner.matches].
var number = num.parse((scanner.lastMatch![0])!);
var number = num.parse(scanner.lastMatch![0]!);

if (scanner.scan('.')) {
scanner.expect(RegExp(r'\d+'));
Expand Down

0 comments on commit 4a5cbc5

Please sign in to comment.