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

Unified Diff: pkg/http_parser/lib/http_parser.dart

Issue 223023003: Extract an http_parser package from shelf. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http_parser/README.md ('k') | pkg/http_parser/lib/src/media_type.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http_parser/lib/http_parser.dart
diff --git a/pkg/shelf/lib/src/util.dart b/pkg/http_parser/lib/http_parser.dart
similarity index 94%
copy from pkg/shelf/lib/src/util.dart
copy to pkg/http_parser/lib/http_parser.dart
index bf8e370804ddd81dbbdbe3f453ca760ad2372e26..3b876d09e4f0a01f29c890370c113ecb238839a1 100644
--- a/pkg/shelf/lib/src/util.dart
+++ b/pkg/http_parser/lib/http_parser.dart
@@ -2,15 +2,11 @@
// 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.
-library shelf.util;
+library http_parser;
-import 'dart:async';
-
-import 'package:stack_trace/stack_trace.dart';
import 'package:string_scanner/string_scanner.dart';
-/// Like [Future.sync], but wraps the Future in [Chain.track] as well.
-Future syncFuture(callback()) => Chain.track(new Future.sync(callback));
+export 'src/media_type.dart';
const _WEEKDAYS = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const _MONTHS = const ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
@@ -122,9 +118,9 @@ int _parseInt(StringScanner scanner, int digits) {
scanner.expect(_digitRegExp);
if (scanner.lastMatch[0].length != digits) {
scanner.error("expected a $digits-digit number.");
- } else {
- return int.parse(scanner.lastMatch[0]);
}
+
+ return int.parse(scanner.lastMatch[0]);
}
/// Parses an timestamp of the form "HH:MM:SS" on a 24-hour clock.
« no previous file with comments | « pkg/http_parser/README.md ('k') | pkg/http_parser/lib/src/media_type.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698