Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 } | |
| OLD | NEW |