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

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

Issue 1580233004: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/http_parser@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « lib/src/media_type.dart ('k') | lib/src/web_socket.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) 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 ///
11 /// [spec]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html 11 /// [spec]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html
12 library http_parser.scan;
13
14 import 'package:string_scanner/string_scanner.dart'; 12 import 'package:string_scanner/string_scanner.dart';
15 13
16 /// An HTTP token. 14 /// An HTTP token.
17 final token = new RegExp(r'[^()<>@,;:"\\/[\]?={} \t\x00-\x1F\x7F]+'); 15 final token = new RegExp(r'[^()<>@,;:"\\/[\]?={} \t\x00-\x1F\x7F]+');
18 16
19 /// Linear whitespace. 17 /// Linear whitespace.
20 final _lws = new RegExp(r"(?:\r\n)?[ \t]+"); 18 final _lws = new RegExp(r"(?:\r\n)?[ \t]+");
21 19
22 /// A quoted string. 20 /// A quoted string.
23 final _quotedString = new RegExp(r'"(?:[^"\x00-\x1F\x7F]|\\.)*"'); 21 final _quotedString = new RegExp(r'"(?:[^"\x00-\x1F\x7F]|\\.)*"');
(...skipping 44 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 66 /// If [name] is passed, it's used to describe the expected value if it's not
69 /// found. 67 /// found.
70 String expectQuotedString(StringScanner scanner, {String name}) { 68 String expectQuotedString(StringScanner scanner, {String name}) {
71 if (name == null) name = "quoted string"; 69 if (name == null) name = "quoted string";
72 scanner.expect(_quotedString, name: name); 70 scanner.expect(_quotedString, name: name);
73 var string = scanner.lastMatch[0]; 71 var string = scanner.lastMatch[0];
74 return string 72 return string
75 .substring(1, string.length - 1) 73 .substring(1, string.length - 1)
76 .replaceAllMapped(_quotedPair, (match) => match[1]); 74 .replaceAllMapped(_quotedPair, (match) => match[1]);
77 } 75 }
OLDNEW
« no previous file with comments | « lib/src/media_type.dart ('k') | lib/src/web_socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698