From 45fe5403ab9341bfab36092c16815490a6084d02 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Thu, 12 Jul 2018 16:16:58 -0700 Subject: [PATCH 1/4] misc: require Dart 2, fix deprecations, prepare to release 1.0.4 Fixes https://github.com/dart-lang/boolean_selector/issues/11 Fixes https://github.com/dart-lang/boolean_selector/pull/8 --- .gitignore | 8 +------- .travis.yml | 2 +- CHANGELOG.md | 4 ++++ analysis_options.yaml | 2 -- codereview.settings | 3 --- lib/src/evaluator.dart | 4 +--- pubspec.yaml | 7 +++---- test/parser_test.dart | 8 ++++---- 8 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 analysis_options.yaml delete mode 100644 codereview.settings diff --git a/.gitignore b/.gitignore index 25a1df3..49ce72d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,3 @@ -.buildlog -.DS_Store -.idea -.pub/ -.settings/ -build/ -packages +.dart_tool/ .packages pubspec.lock diff --git a/.travis.yml b/.travis.yml index 610bd03..7e423c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: dart sudo: false dart: - - stable + #- stable - dev dart_task: - test: -p vm diff --git a/CHANGELOG.md b/CHANGELOG.md index 367abee..302c8d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.4 + +* Now requires Dart 2. + ## 1.0.3 * Work around an inference bug in the new common front-end. diff --git a/analysis_options.yaml b/analysis_options.yaml deleted file mode 100644 index a10d4c5..0000000 --- a/analysis_options.yaml +++ /dev/null @@ -1,2 +0,0 @@ -analyzer: - strong-mode: true diff --git a/codereview.settings b/codereview.settings deleted file mode 100644 index 3de3f59..0000000 --- a/codereview.settings +++ /dev/null @@ -1,3 +0,0 @@ -CODE_REVIEW_SERVER: https://codereview.chromium.org/ -VIEW_VC: https://github.com/dart-lang/boolean_selector/commit/ -CC_LIST: reviews@dartlang.org \ No newline at end of file diff --git a/lib/src/evaluator.dart b/lib/src/evaluator.dart index 6401a37..d69e98b 100644 --- a/lib/src/evaluator.dart +++ b/lib/src/evaluator.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:collection/collection.dart'; - import 'ast.dart'; import 'visitor.dart'; @@ -17,7 +15,7 @@ class Evaluator implements Visitor { Evaluator(semantics) : _semantics = semantics is Iterable - ? DelegatingIterable.typed(semantics.toSet()).contains + ? semantics.toSet().cast().contains : semantics as _Semantics; bool visitVariable(VariableNode node) => _semantics(node.name); diff --git a/pubspec.yaml b/pubspec.yaml index 27961af..580b404 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,16 +1,15 @@ name: boolean_selector -version: 1.0.3 +version: 1.0.4 description: A flexible syntax for boolean expressions. author: Dart Team homepage: https://github.com/dart-lang/boolean_selector environment: - sdk: '>=1.8.0 <2.0.0' + sdk: '>=2.0.0-dev.58 <3.0.0' dependencies: - collection: '^1.5.0' source_span: '^1.0.0' string_scanner: '>=0.1.1 <2.0.0' dev_dependencies: - test: '^0.12.0' + test: ^1.2.0 diff --git a/test/parser_test.dart b/test/parser_test.dart index 9e801f2..1b7128f 100644 --- a/test/parser_test.dart +++ b/test/parser_test.dart @@ -8,16 +8,16 @@ import 'package:boolean_selector/src/ast.dart'; import 'package:boolean_selector/src/parser.dart'; /// A matcher that asserts that a value is a [ConditionalNode]. -Matcher _isConditionalNode = new isInstanceOf(); +final _isConditionalNode = new TypeMatcher(); /// A matcher that asserts that a value is an [OrNode]. -Matcher _isOrNode = new isInstanceOf(); +final _isOrNode = new TypeMatcher(); /// A matcher that asserts that a value is an [AndNode]. -Matcher _isAndNode = new isInstanceOf(); +final _isAndNode = new TypeMatcher(); /// A matcher that asserts that a value is a [NotNode]. -Matcher _isNotNode = new isInstanceOf(); +final _isNotNode = new TypeMatcher(); void main() { group("parses a conditional expression", () { From bc453d3bfc0f39693f43ef80e06aef279fe61164 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Thu, 12 Jul 2018 16:18:56 -0700 Subject: [PATCH 2/4] dartfmt oops --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7e423c4..d333c4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ dart_task: matrix: include: - - dart: stable + - dart: dev dart_task: dartfmt # Only building master means that we don't run two builds for each pull request. From 5d721eb88f76b12f1a98cae577786993c42f7e30 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Thu, 12 Jul 2018 16:34:59 -0700 Subject: [PATCH 3/4] simplify --- lib/src/evaluator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/evaluator.dart b/lib/src/evaluator.dart index d69e98b..f2ed7d6 100644 --- a/lib/src/evaluator.dart +++ b/lib/src/evaluator.dart @@ -15,7 +15,7 @@ class Evaluator implements Visitor { Evaluator(semantics) : _semantics = semantics is Iterable - ? semantics.toSet().cast().contains + ? semantics.toSet().contains : semantics as _Semantics; bool visitVariable(VariableNode node) => _semantics(node.name); From 1247838261327e1b46c1b5bc4c1c15c69a17a653 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Thu, 12 Jul 2018 16:46:03 -0700 Subject: [PATCH 4/4] travis tweaks --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d333c4d..d402e3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,8 @@ dart: dart_task: - test: -p vm xvfb: false - - test: -p firefox + # Set concurrency to 1 to avoid flakes on Travis + - test: -p firefox -j 1 - dartanalyzer matrix: