| 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 test.backend.platform_selector; | |
| 6 | |
| 7 import 'package:source_span/source_span.dart'; | 5 import 'package:source_span/source_span.dart'; |
| 8 | 6 |
| 9 import 'operating_system.dart'; | 7 import 'operating_system.dart'; |
| 10 import 'platform_selector/ast.dart'; | 8 import 'platform_selector/ast.dart'; |
| 11 import 'platform_selector/evaluator.dart'; | 9 import 'platform_selector/evaluator.dart'; |
| 12 import 'platform_selector/parser.dart'; | 10 import 'platform_selector/parser.dart'; |
| 13 import 'platform_selector/visitor.dart'; | 11 import 'platform_selector/visitor.dart'; |
| 14 import 'test_platform.dart'; | 12 import 'test_platform.dart'; |
| 15 | 13 |
| 16 /// The set of all valid variable names. | 14 /// The set of all valid variable names. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 /// and it isn't done when parsing to avoid coupling the syntax too tightly to | 92 /// and it isn't done when parsing to avoid coupling the syntax too tightly to |
| 95 /// the semantics. | 93 /// the semantics. |
| 96 class _VariableValidator extends RecursiveVisitor { | 94 class _VariableValidator extends RecursiveVisitor { |
| 97 const _VariableValidator(); | 95 const _VariableValidator(); |
| 98 | 96 |
| 99 void visitVariable(VariableNode node) { | 97 void visitVariable(VariableNode node) { |
| 100 if (_validVariables.contains(node.name)) return; | 98 if (_validVariables.contains(node.name)) return; |
| 101 throw new SourceSpanFormatException("Undefined variable.", node.span); | 99 throw new SourceSpanFormatException("Undefined variable.", node.span); |
| 102 } | 100 } |
| 103 } | 101 } |
| OLD | NEW |