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

Side by Side Diff: sdk/lib/core/uri.dart

Issue 344803002: Fix bug in gen-delims table. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also fix lookup function. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/corelib/uri_test.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * A parsed URI, such as a URL. 8 * A parsed URI, such as a URL.
9 * 9 *
10 * **See also:** 10 * **See also:**
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 buffer.write(component.substring(sectionStart, end)); 1201 buffer.write(component.substring(sectionStart, end));
1202 } 1202 }
1203 return buffer.toString(); 1203 return buffer.toString();
1204 } 1204 }
1205 1205
1206 static bool _isSchemeCharacter(int ch) { 1206 static bool _isSchemeCharacter(int ch) {
1207 return ch < 128 && ((_schemeTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); 1207 return ch < 128 && ((_schemeTable[ch >> 4] & (1 << (ch & 0x0f))) != 0);
1208 } 1208 }
1209 1209
1210 static bool _isGeneralDelimiter(int ch) { 1210 static bool _isGeneralDelimiter(int ch) {
1211 return ch <= 64 && 1211 return ch <= _RIGHT_BRACKET &&
1212 ((_genDelimitersTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); 1212 ((_genDelimitersTable[ch >> 4] & (1 << (ch & 0x0f))) != 0);
1213 } 1213 }
1214 1214
1215 /** 1215 /**
1216 * Returns whether the URI is absolute. 1216 * Returns whether the URI is absolute.
1217 */ 1217 */
1218 bool get isAbsolute => scheme != "" && fragment == ""; 1218 bool get isAbsolute => scheme != "" && fragment == "";
1219 1219
1220 String _merge(String base, String reference) { 1220 String _merge(String base, String reference) {
1221 if (base == "") return "/$reference"; 1221 if (base == "") return "/$reference";
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
2078 // General delimiter characters, RFC 3986 section 2.2. 2078 // General delimiter characters, RFC 3986 section 2.2.
2079 // gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" 2079 // gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
2080 // 2080 //
2081 static const _genDelimitersTable = const [ 2081 static const _genDelimitersTable = const [
2082 // LSB MSB 2082 // LSB MSB
2083 // | | 2083 // | |
2084 0x0000, // 0x00 - 0x0f 0000000000000000 2084 0x0000, // 0x00 - 0x0f 0000000000000000
2085 0x0000, // 0x10 - 0x1f 0000000000000000 2085 0x0000, // 0x10 - 0x1f 0000000000000000
2086 // # / 2086 // # /
2087 0x8008, // 0x20 - 0x2f 0001000000000001 2087 0x8008, // 0x20 - 0x2f 0001000000000001
2088 // : [ ]? 2088 // : ?
2089 0xe400, // 0x30 - 0x3f 0000000000101011 2089 0x8400, // 0x30 - 0x3f 0000000000100001
2090 // @ 2090 // @
2091 0x0001, // 0x40 - 0x4f 1000000000000000 2091 0x0001, // 0x40 - 0x4f 1000000000000000
2092 // 2092 // [ ]
2093 0x0000, // 0x50 - 0x5f 0000000000000000 2093 0x2800, // 0x50 - 0x5f 0000000000010100
2094 // 2094 //
2095 0x0000, // 0x60 - 0x6f 0000000000000000 2095 0x0000, // 0x60 - 0x6f 0000000000000000
2096 // 2096 //
2097 0x0000]; // 0x70 - 0x7f 0000000000000000 2097 0x0000]; // 0x70 - 0x7f 0000000000000000
2098 2098
2099 // Characters allowed in the userinfo as of RFC 3986. 2099 // Characters allowed in the userinfo as of RFC 3986.
2100 // RFC 3986 Apendix A 2100 // RFC 3986 Apendix A
2101 // userinfo = *( unreserved / pct-encoded / sub-delims / ':') 2101 // userinfo = *( unreserved / pct-encoded / sub-delims / ':')
2102 static const _userinfoTable = const [ 2102 static const _userinfoTable = const [
2103 // LSB MSB 2103 // LSB MSB
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
2194 0xafff, // 0x30 - 0x3f 1111111111110101 2194 0xafff, // 0x30 - 0x3f 1111111111110101
2195 // @ABCDEFGHIJKLMNO 2195 // @ABCDEFGHIJKLMNO
2196 0xffff, // 0x40 - 0x4f 1111111111111111 2196 0xffff, // 0x40 - 0x4f 1111111111111111
2197 // PQRSTUVWXYZ _ 2197 // PQRSTUVWXYZ _
2198 0x87ff, // 0x50 - 0x5f 1111111111100001 2198 0x87ff, // 0x50 - 0x5f 1111111111100001
2199 // abcdefghijklmno 2199 // abcdefghijklmno
2200 0xfffe, // 0x60 - 0x6f 0111111111111111 2200 0xfffe, // 0x60 - 0x6f 0111111111111111
2201 // pqrstuvwxyz ~ 2201 // pqrstuvwxyz ~
2202 0x47ff]; // 0x70 - 0x7f 1111111111100010 2202 0x47ff]; // 0x70 - 0x7f 1111111111100010
2203 } 2203 }
OLDNEW
« no previous file with comments | « no previous file | tests/corelib/uri_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698