Line data Source code
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 3 : // BSD-style license that can be found in the LICENSE file. 4 : 5 : import '../boolean_selector.dart'; 6 : 7 : /// A selector that matches all inputs. 8 : class All implements BooleanSelector { 9 : // TODO(nweiz): Stop explicitly providing a type argument when sdk#32412 is 10 : // fixed. 11 : @override 12 : final Iterable<String> variables = const <String>[]; 13 : 14 11 : const All(); 15 : 16 6 : @override 17 : bool evaluate(bool Function(String variable) semantics) => true; 18 : 19 0 : @override 20 : BooleanSelector intersection(BooleanSelector other) => other; 21 : 22 0 : @override 23 : BooleanSelector union(BooleanSelector other) => this; 24 : 25 0 : @override 26 : void validate(bool Function(String variable) isDefined) {} 27 : 28 0 : @override 29 : String toString() => '<all>'; 30 : }