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

Annotate method error with alwaysThrows annotation. #11

Merged
merged 2 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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