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

Side by Side Diff: lib/src/scan.dart

Issue 1390353008: Add a DataUri class. (Closed) Base URL: git@github.com:dart-lang/http_parser@master
Patch Set: merge Created 5 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
OLDNEW
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 /// A library for broadly-useful functions and regular expressions for scanning 5 /// A library for broadly-useful functions and regular expressions for scanning
6 /// HTTP entities. 6 /// HTTP entities.
7 /// 7 ///
8 /// Many of the regular expressions come from [section 2.2 of the HTTP 8 /// Many of the regular expressions come from [section 2.2 of the HTTP
9 /// spec][spec]. 9 /// spec][spec].
10 /// 10 ///
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 /// If [name] is passed, it's used to describe the expected value if it's not 68 /// If [name] is passed, it's used to describe the expected value if it's not
69 /// found. 69 /// found.
70 String expectQuotedString(StringScanner scanner, {String name}) { 70 String expectQuotedString(StringScanner scanner, {String name}) {
71 if (name == null) name = "quoted string"; 71 if (name == null) name = "quoted string";
72 scanner.expect(_quotedString, name: name); 72 scanner.expect(_quotedString, name: name);
73 var string = scanner.lastMatch[0]; 73 var string = scanner.lastMatch[0];
74 return string 74 return string
75 .substring(1, string.length - 1) 75 .substring(1, string.length - 1)
76 .replaceAllMapped(_quotedPair, (match) => match[1]); 76 .replaceAllMapped(_quotedPair, (match) => match[1]);
77 } 77 }
78
79 bool scanPercentToken(StringScanner scanner) {
80 var position = scanner.position;
81 if (!scanner.scan(token)) return false;
82 var token =
kevmoo 2015/10/19 22:45:21 this looks very broken
nweiz 2015/10/19 23:08:32 Done.
83 }
OLDNEW
« lib/src/data_uri.dart ('K') | « lib/src/data_uri.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698