Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: lib/boolean_selector.dart

Issue 1715553002: Define equality for boolean selectors. (Closed) Base URL: git@github.com:dart-lang/boolean_selector@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/src/ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:source_span/source_span.dart'; 5 import 'package:source_span/source_span.dart';
6 6
7 import 'src/all.dart'; 7 import 'src/all.dart';
8 import 'src/impl.dart'; 8 import 'src/impl.dart';
9 import 'src/none.dart'; 9 import 'src/none.dart';
10 10
11 /// A boolean expression that evaluates to `true` or `false` based on certain 11 /// A boolean expression that evaluates to `true` or `false` based on certain
12 /// inputs. 12 /// inputs.
13 /// 13 ///
14 /// The syntax is mostly Dart's expression syntax restricted to boolean 14 /// The syntax is mostly Dart's expression syntax restricted to boolean
15 /// operations. See [the README][] for full details. 15 /// operations. See [the README][] for full details.
16 /// 16 ///
17 /// [the README]: https://github.com/dart-lang/boolean_selector/blob/master/READ ME.md 17 /// [the README]: https://github.com/dart-lang/boolean_selector/blob/master/READ ME.md
18 ///
19 /// Boolean selectors support structural equality. Two selectors that have the
20 /// same parsed structure are considered equal.
18 abstract class BooleanSelector { 21 abstract class BooleanSelector {
19 /// A selector that accepts all inputs. 22 /// A selector that accepts all inputs.
20 static const all = const All(); 23 static const all = const All();
21 24
22 /// A selector that accepts no inputs. 25 /// A selector that accepts no inputs.
23 static const none = const None(); 26 static const none = const None();
24 27
25 /// All the variables in this selector, in the order they appear. 28 /// All the variables in this selector, in the order they appear.
26 Iterable<String> get variables; 29 Iterable<String> get variables;
27 30
(...skipping 18 matching lines...) Expand all
46 /// Returns a new [BooleanSelector] that matches all inputs matched by either 49 /// Returns a new [BooleanSelector] that matches all inputs matched by either
47 /// [this] or [other]. 50 /// [this] or [other].
48 BooleanSelector union(BooleanSelector other); 51 BooleanSelector union(BooleanSelector other);
49 52
50 /// Throws a [FormatException] if any variables are undefined. 53 /// Throws a [FormatException] if any variables are undefined.
51 /// 54 ///
52 /// The [isDefined] function should return `true` for any variables that are 55 /// The [isDefined] function should return `true` for any variables that are
53 /// considered valid, and `false` for any invalid or undefined variables. 56 /// considered valid, and `false` for any invalid or undefined variables.
54 void validate(bool isDefined(String variable)); 57 void validate(bool isDefined(String variable));
55 } 58 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698