Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 97cdbe2

Browse files
authored
Annotate method error with alwaysThrows annotation. (#11)
1 parent 9166ca0 commit 97cdbe2

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.0
2+
3+
* Add @alwaysThrows annotation to error method.
4+
15
## 1.0.3
26

37
* Set max SDK version to `<3.0.0`, and adjust other dependencies.

lib/src/string_scanner.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:charcode/charcode.dart';
6+
import 'package:meta/meta.dart';
67
import 'package:source_span/source_span.dart';
78

89
import 'exception.dart';
@@ -197,6 +198,7 @@ class StringScanner {
197198
/// position; if only [position] is passed, [length] defaults to 0.
198199
///
199200
/// It's an error to pass [match] at the same time as [position] or [length].
201+
@alwaysThrows
200202
void error(String message, {Match match, int position, int length}) {
201203
validateErrorArgs(string, match, position, length);
202204

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: string_scanner
2-
version: 1.0.3
2+
version: 1.0.4
33

44
description: A class for parsing strings using a sequence of patterns.
55
author: Dart Team <misc@dartlang.org>
@@ -10,6 +10,7 @@ environment:
1010

1111
dependencies:
1212
charcode: ^1.1.0
13+
meta: ^1.1.0
1314
source_span: ^1.4.0
1415

1516
dev_dependencies:

0 commit comments

Comments
 (0)