Fix analyzer errors/warnings for Pub.

Review URL: https://codereview.chromium.org//11609005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16299 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
nweiz@google.com 2012-12-19 01:08:42 +00:00
parent 0b54c34c24
commit 71e2fc2bf4
10 changed files with 29 additions and 12 deletions

View file

@ -294,7 +294,7 @@ class Builder {
buffer.clear();
buffer.add(part);
} else {
if (part.length > 0 && style.separatorPattern.hasMatch(part[0])) {
if (part.length > 0 && part[0].contains(style.separatorPattern)) {
// The part starts with a separator, so we don't need to add one.
} else if (needsSeparator) {
buffer.add(separator);
@ -306,7 +306,7 @@ class Builder {
// Unless this part ends with a separator, we'll need to add one before
// the next part.
needsSeparator = part.length > 0 &&
!style.separatorPattern.hasMatch(part[part.length - 1]);
!part[part.length - 1].contains(style.separatorPattern);
}
return buffer.toString();
@ -517,9 +517,10 @@ class Style {
/// "\" is the canonical one.
final Pattern separatorPattern;
/// The [Pattern] that can be used to match the root prefix of an absolute
// TODO(nweiz): make this a Pattern when issue 7080 is fixed.
/// The [RegExp] that can be used to match the root prefix of an absolute
/// path in this style.
final Pattern _rootPattern;
final RegExp _rootPattern;
/// Gets the root prefix of [path] if path is absolute. If [path] is relative,
/// returns `null`.

View file

@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
/// Helpers for dealing with HTTP.
library http;
library pub.http;
import 'dart:io';
import 'dart:json';

View file

@ -143,8 +143,10 @@ abstract class Source {
* This doesn't need to be implemented if [shouldCache] is false, or if
* [installToSystemCache] is implemented.
*/
String systemCacheDirectory(PackageId id) =>
join(systemCacheRoot, packageName(id.description));
String systemCacheDirectory(PackageId id) {
throw 'Source.systemCacheDirectory must be implemented if shouldCache is '
'true and installToSystemCache is not implemented.';
}
/**
* When a [Pubspec] or [LockFile] is parsed, it reads in the description for

View file

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of yaml;
/**
* Takes a parsed YAML document (what the spec calls the "serialization tree")
* and resolves aliases, resolves tags, and parses scalars to produce the

View file

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of yaml;
/**
* Takes a parsed and composed YAML document (what the spec calls the
* "representation graph") and creates native Dart objects that represent that

View file

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of yaml;
// This file contains the node classes for the internal representations of YAML
// documents. These nodes are used for both the serialization tree and the
// representation graph.

View file

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of yaml;
/**
* Translates a string of characters into a YAML serialization tree.
*
@ -1805,10 +1807,10 @@ class _Parser {
_Node s_l_blockScalar(int indent, int ctx) => transaction(() {
if (!truth(s_separate(indent + 1, ctx))) return null;
var props = transaction(() {
var props = c_ns_properties(indent + 1, ctx);
if (!truth(props)) return null;
var innerProps = c_ns_properties(indent + 1, ctx);
if (!truth(innerProps)) return null;
if (!truth(s_separate(indent + 1, ctx))) return null;
return props;
return innerProps;
});
var node = or([() => c_l_literal(indent), () => c_l_folded(indent)]);

View file

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of yaml;
/** The visitor pattern for YAML documents. */
class _Visitor {
/** Returns [alias]. */

View file

@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of yaml;
/**
* This class wraps behaves almost identically to the normal Dart Map
* implementation, with the following differences:

View file

@ -1424,7 +1424,8 @@ class ScheduledProcess {
/// Reads the next line of stdout from the process.
Future<String> nextLine() {
return _scheduleValue((_) {
return timeout(_stdout.chain(readLine), _SCHEDULE_TIMEOUT,
return timeout(_stdout.chain((stream) => readLine(stream)),
_SCHEDULE_TIMEOUT,
"waiting for the next stdout line from process $name");
});
}
@ -1432,7 +1433,8 @@ class ScheduledProcess {
/// Reads the next line of stderr from the process.
Future<String> nextErrLine() {
return _scheduleValue((_) {
return timeout(_stderr.chain(readLine), _SCHEDULE_TIMEOUT,
return timeout(_stderr.chain((stream) => readLine(stream)),
_SCHEDULE_TIMEOUT,
"waiting for the next stderr line from process $name");
});
}