OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library unittest.backend.platform_selector.evaluator; | 5 library test.backend.platform_selector.evaluator; |
6 | 6 |
7 import '../operating_system.dart'; | 7 import '../operating_system.dart'; |
8 import '../test_platform.dart'; | 8 import '../test_platform.dart'; |
9 import 'ast.dart'; | 9 import 'ast.dart'; |
10 import 'visitor.dart'; | 10 import 'visitor.dart'; |
11 | 11 |
12 /// A visitor for evaluating platform selectors against a specific | 12 /// A visitor for evaluating platform selectors against a specific |
13 /// [TestPlatform] and [OperatingSystem]. | 13 /// [TestPlatform] and [OperatingSystem]. |
14 class Evaluator implements Visitor<bool> { | 14 class Evaluator implements Visitor<bool> { |
15 /// The platform to test against. | 15 /// The platform to test against. |
(...skipping 24 matching lines...) Expand all Loading... |
40 bool visitOr(OrNode node) => | 40 bool visitOr(OrNode node) => |
41 node.left.accept(this) || node.right.accept(this); | 41 node.left.accept(this) || node.right.accept(this); |
42 | 42 |
43 bool visitAnd(AndNode node) => | 43 bool visitAnd(AndNode node) => |
44 node.left.accept(this) && node.right.accept(this); | 44 node.left.accept(this) && node.right.accept(this); |
45 | 45 |
46 bool visitConditional(ConditionalNode node) => node.condition.accept(this) | 46 bool visitConditional(ConditionalNode node) => node.condition.accept(this) |
47 ? node.whenTrue.accept(this) | 47 ? node.whenTrue.accept(this) |
48 : node.whenFalse.accept(this); | 48 : node.whenFalse.accept(this); |
49 } | 49 } |
OLD | NEW |