| 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.parser; | |
| 6 | |
| 7 import 'package:source_span/source_span.dart'; | 5 import 'package:source_span/source_span.dart'; |
| 8 | 6 |
| 9 import 'ast.dart'; | 7 import 'ast.dart'; |
| 10 import 'scanner.dart'; | 8 import 'scanner.dart'; |
| 11 import 'token.dart'; | 9 import 'token.dart'; |
| 12 | 10 |
| 13 /// A class for parsing a platform selector. | 11 /// A class for parsing a platform selector. |
| 14 /// | 12 /// |
| 15 /// Platform selectors use a stripped-down version of the Dart expression | 13 /// Platform selectors use a stripped-down version of the Dart expression |
| 16 /// syntax that only contains variables, parentheses, and boolean operators. | 14 /// syntax that only contains variables, parentheses, and boolean operators. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return child; | 96 return child; |
| 99 | 97 |
| 100 case TokenType.identifier: | 98 case TokenType.identifier: |
| 101 return new VariableNode(token.name, token.span); | 99 return new VariableNode(token.name, token.span); |
| 102 | 100 |
| 103 default: | 101 default: |
| 104 throw new SourceSpanFormatException("Expected expression.", token.span); | 102 throw new SourceSpanFormatException("Expected expression.", token.span); |
| 105 } | 103 } |
| 106 } | 104 } |
| 107 } | 105 } |
| OLD | NEW |