Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

misc: require Dart 2, fix deprecations, prepare to release 1.0.4 #12

Merged
merged 4 commits into from
Jul 12, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
.buildlog
.DS_Store
.idea
.pub/
.settings/
build/
packages
.dart_tool/
.packages
pubspec.lock
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: dart
sudo: false
dart:
- stable
#- stable
- dev
dart_task:
- test: -p vm
Expand All @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 0 additions & 2 deletions analysis_options.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions codereview.settings

This file was deleted.

4 changes: 1 addition & 3 deletions lib/src/evaluator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -17,7 +15,7 @@ class Evaluator implements Visitor<bool> {

Evaluator(semantics)
: _semantics = semantics is Iterable
? DelegatingIterable.typed(semantics.toSet()).contains
? semantics.toSet().cast().contains

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be .cast<String>().

: semantics as _Semantics;

bool visitVariable(VariableNode node) => _semantics(node.name);
Expand Down
7 changes: 3 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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
8 changes: 4 additions & 4 deletions test/parser_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConditionalNode>();
final _isConditionalNode = new TypeMatcher<ConditionalNode>();

/// A matcher that asserts that a value is an [OrNode].
Matcher _isOrNode = new isInstanceOf<OrNode>();
final _isOrNode = new TypeMatcher<OrNode>();

/// A matcher that asserts that a value is an [AndNode].
Matcher _isAndNode = new isInstanceOf<AndNode>();
final _isAndNode = new TypeMatcher<AndNode>();

/// A matcher that asserts that a value is a [NotNode].
Matcher _isNotNode = new isInstanceOf<NotNode>();
final _isNotNode = new TypeMatcher<NotNode>();

void main() {
group("parses a conditional expression", () {
Expand Down