Skip to content

Commit

Permalink
Annotate method error with alwaysThrows annotation. (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
keertip committed Aug 3, 2018
1 parent 9166ca0 commit 97cdbe2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.0

* Add @alwaysThrows annotation to error method.

## 1.0.3

* Set max SDK version to `<3.0.0`, and adjust other dependencies.
Expand Down
2 changes: 2 additions & 0 deletions lib/src/string_scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:charcode/charcode.dart';
import 'package:meta/meta.dart';
import 'package:source_span/source_span.dart';

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

Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: string_scanner
version: 1.0.3
version: 1.0.4

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

dependencies:
charcode: ^1.1.0
meta: ^1.1.0
source_span: ^1.4.0

dev_dependencies:
Expand Down

0 comments on commit 97cdbe2

Please sign in to comment.