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.scanner; | |
6 | |
7 import 'package:string_scanner/string_scanner.dart'; | 5 import 'package:string_scanner/string_scanner.dart'; |
8 | 6 |
9 import '../../utils.dart'; | 7 import '../../utils.dart'; |
10 import 'token.dart'; | 8 import 'token.dart'; |
11 | 9 |
12 /// A regular expression matching both whitespace and single-line comments. | 10 /// A regular expression matching both whitespace and single-line comments. |
13 /// | 11 /// |
14 /// This will only match if consumes at least one character. | 12 /// This will only match if consumes at least one character. |
15 final _whitespaceAndSingleLineComments = | 13 final _whitespaceAndSingleLineComments = |
16 new RegExp(r"([ \t\n]+|//[^\n]*(\n|$))+"); | 14 new RegExp(r"([ \t\n]+|//[^\n]*(\n|$))+"); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 if (!_scanner.scan("/*")) return false; | 137 if (!_scanner.scan("/*")) return false; |
140 | 138 |
141 while (_scanner.scan(_multiLineCommentBody) || _multiLineComment()) { | 139 while (_scanner.scan(_multiLineCommentBody) || _multiLineComment()) { |
142 // Do nothing. | 140 // Do nothing. |
143 } | 141 } |
144 _scanner.expect("*/"); | 142 _scanner.expect("*/"); |
145 | 143 |
146 return true; | 144 return true; |
147 } | 145 } |
148 } | 146 } |
OLD | NEW |