From 38b5cc537a5c8de95c94e2ab9178078184e6407e Mon Sep 17 00:00:00 2001 From: Keerti Parthasarathy Date: Fri, 3 Aug 2018 12:30:03 -0700 Subject: [PATCH 1/2] Annotate method error with alwaysThrows annotation. --- CHANGELOG.md | 4 ++++ lib/src/string_scanner.dart | 2 ++ pubspec.yaml | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2909bea..43b9453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.4 + +* Add @alwaysThrows annotation to error method. + ## 1.0.3 * Set max SDK version to `<3.0.0`, and adjust other dependencies. diff --git a/lib/src/string_scanner.dart b/lib/src/string_scanner.dart index ea3d6d6..d32dc38 100644 --- a/lib/src/string_scanner.dart +++ b/lib/src/string_scanner.dart @@ -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'; @@ -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); diff --git a/pubspec.yaml b/pubspec.yaml index 7c87a0d..5ecd54e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 @@ -10,6 +10,7 @@ environment: dependencies: charcode: ^1.1.0 + meta: ^1.1.5 source_span: ^1.4.0 dev_dependencies: From 7ba0c2309a0f4c19f0eb719912dd8f2bf6d681b0 Mon Sep 17 00:00:00 2001 From: Keerti Parthasarathy Date: Fri, 3 Aug 2018 13:05:08 -0700 Subject: [PATCH 2/2] address comments --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43b9453..3602fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.0.4 +## 1.1.0 * Add @alwaysThrows annotation to error method. diff --git a/pubspec.yaml b/pubspec.yaml index 5ecd54e..7691990 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: charcode: ^1.1.0 - meta: ^1.1.5 + meta: ^1.1.0 source_span: ^1.4.0 dev_dependencies: