mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix fn_test.v and urllib.v
This commit is contained in:
parent
350e13679c
commit
8d3617b3de
@ -106,7 +106,7 @@ fn test_mut_ptr() {
|
|||||||
assert buf[0] == 77
|
assert buf[0] == 77
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_high_fn(f fn(int) int) {
|
fn high_fn(f fn(int) int) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ fn error_msg(message, val string) string {
|
|||||||
// reserved characters correctly. See golang.org/issue/5684.
|
// reserved characters correctly. See golang.org/issue/5684.
|
||||||
fn should_escape(c byte, mode EncodingMode) bool {
|
fn should_escape(c byte, mode EncodingMode) bool {
|
||||||
// §2.3 Unreserved characters (alphanum)
|
// §2.3 Unreserved characters (alphanum)
|
||||||
if `a` <= c && c <= `z` || `A` <= c && c <= `Z` || `0` <= c && c <= `9` {
|
if (`a` <= c && c <= `z`) || (`A` <= c && c <= `Z`) || (`0` <= c && c <= `9`) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,10 +377,10 @@ fn (u &Userinfo) string() string {
|
|||||||
fn split_by_scheme(rawurl string) ?[]string {
|
fn split_by_scheme(rawurl string) ?[]string {
|
||||||
for i := 0; i < rawurl.len; i++ {
|
for i := 0; i < rawurl.len; i++ {
|
||||||
c := rawurl[i]
|
c := rawurl[i]
|
||||||
if `a` <= c && c <= `z` || `A` <= c && c <= `Z` {
|
if (`a` <= c && c <= `z`) || (`A` <= c && c <= `Z`) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
else if `0` <= c && c <= `9` || c == `+` || c == `-` || c == `.` {
|
else if (`0` <= c && c <= `9`) || (c == `+` || c == `-` || c == `.`) {
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
return ['', rawurl]
|
return ['', rawurl]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user