OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 pub.preprocess; | |
6 | |
7 import 'package:pub_semver/pub_semver.dart'; | 5 import 'package:pub_semver/pub_semver.dart'; |
8 import 'package:string_scanner/string_scanner.dart'; | 6 import 'package:string_scanner/string_scanner.dart'; |
9 | 7 |
10 import 'utils.dart'; | 8 import 'utils.dart'; |
11 | 9 |
12 /// Runs a simple preprocessor over [input] to remove sections that are | 10 /// Runs a simple preprocessor over [input] to remove sections that are |
13 /// incompatible with the available barback version. | 11 /// incompatible with the available barback version. |
14 /// | 12 /// |
15 /// [versions] are the available versions of each installed package, and | 13 /// [versions] are the available versions of each installed package, and |
16 /// [sourceUrl] is a [String] or [Uri] indicating where [input] came from. It's | 14 /// [sourceUrl] is a [String] or [Uri] indicating where [input] came from. It's |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 _emitText(); | 134 _emitText(); |
137 } | 135 } |
138 _scanner.expect("//#"); | 136 _scanner.expect("//#"); |
139 _scanner.scan(new RegExp(r"[ \t]*")); | 137 _scanner.scan(new RegExp(r"[ \t]*")); |
140 } | 138 } |
141 | 139 |
142 _scanner.expect("end"); | 140 _scanner.expect("end"); |
143 if (!_scanner.isDone) _scanner.expect("\n"); | 141 if (!_scanner.isDone) _scanner.expect("\n"); |
144 } | 142 } |
145 } | 143 } |
OLD | NEW |