| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |