Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: sdk/lib/_internal/pub/lib/src/preprocess.dart

Issue 602253002: Use pub_semver package in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/package.dart ('k') | sdk/lib/_internal/pub/lib/src/pubspec.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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; 5 library pub.preprocess;
6 6
7 import 'package:pub_semver/pub_semver.dart';
7 import 'package:string_scanner/string_scanner.dart'; 8 import 'package:string_scanner/string_scanner.dart';
8 9
9 import 'version.dart';
10
11 /// Runs a simple preprocessor over [input] to remove sections that are 10 /// Runs a simple preprocessor over [input] to remove sections that are
12 /// incompatible with the available barback version. 11 /// incompatible with the available barback version.
13 /// 12 ///
14 /// [versions] are the available versions of each installed package, and 13 /// [versions] are the available versions of each installed package, and
15 /// [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
16 /// used for error reporting. 15 /// used for error reporting.
17 /// 16 ///
18 /// For the most part, the preprocessor leaves text in the source document 17 /// For the most part, the preprocessor leaves text in the source document
19 /// alone. However, it handles two types of lines specially. Lines that begin 18 /// alone. However, it handles two types of lines specially. Lines that begin
20 /// with `//>` are uncommented by the preprocessor, and lines that begin with 19 /// with `//>` are uncommented by the preprocessor, and lines that begin with
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 _emitText(); 134 _emitText();
136 } 135 }
137 _scanner.expect("//#"); 136 _scanner.expect("//#");
138 _scanner.scan(new RegExp(r"[ \t]*")); 137 _scanner.scan(new RegExp(r"[ \t]*"));
139 } 138 }
140 139
141 _scanner.expect("end"); 140 _scanner.expect("end");
142 if (!_scanner.isDone) _scanner.expect("\n"); 141 if (!_scanner.isDone) _scanner.expect("\n");
143 } 142 }
144 } 143 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/package.dart ('k') | sdk/lib/_internal/pub/lib/src/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698