1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.ast: fix fmt of 'bytestr' to '&byte' (#12014)

This commit is contained in:
yuyi 2021-09-29 18:53:46 +08:00 committed by GitHub
parent d39fec3479
commit 8789cc422c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 13 deletions

View File

@ -31,8 +31,6 @@ const (
'vlib/sqlite/orm.v' /* mut c &int -> mut c int */, 'vlib/sqlite/orm.v' /* mut c &int -> mut c int */,
'vlib/builtin/int_test.v' /* special number formatting that should be tested */, 'vlib/builtin/int_test.v' /* special number formatting that should be tested */,
// TODOs and unfixed vfmt bugs // TODOs and unfixed vfmt bugs
'vlib/builtin/int.v' /* TODO byteptr: vfmt converts `pub fn (nn byteptr) str() string {` to `nn &byte` and that conflicts with `nn byte` */,
'vlib/builtin/string_charptr_byteptr_helpers.v' /* TODO byteptr: a temporary shim to ease the byteptr=>&byte transition */,
'vlib/v/tests/interop_test.v', /* bad comment formatting */ 'vlib/v/tests/interop_test.v', /* bad comment formatting */
'vlib/v/gen/js/tests/js.v', /* local `hello` fn, gets replaced with module `hello` aliased as `hl` */ 'vlib/v/gen/js/tests/js.v', /* local `hello` fn, gets replaced with module `hello` aliased as `hl` */
] ]

View File

@ -313,7 +313,6 @@ pub fn (nn i8) hex() string {
return '00' return '00'
} }
return u64_to_hex(u64(nn), 2) return u64_to_hex(u64(nn), 2)
//return byte(nn).hex()
} }
// hex returns the value of the `u16` as a hexadecimal `string`. // hex returns the value of the `u16` as a hexadecimal `string`.

View File

@ -948,17 +948,9 @@ pub fn (t &Table) type_to_str_using_aliases(typ Type, import_aliases map[string]
// *clearly*, and that when a new kind is added, it should also be handled // *clearly*, and that when a new kind is added, it should also be handled
// explicitly. // explicitly.
match sym.kind { match sym.kind {
.int_literal, .float_literal { .int_literal, .float_literal {}
res = sym.name
}
.byteptr {
res = '&byte'
}
.charptr {
res = '&char'
}
.i8, .i16, .int, .i64, .isize, .byte, .u8, .u16, .u32, .u64, .usize, .f32, .f64, .char, .i8, .i16, .int, .i64, .isize, .byte, .u8, .u16, .u32, .u64, .usize, .f32, .f64, .char,
.rune, .string, .bool, .none_, .voidptr { .rune, .string, .bool, .none_, .voidptr, .byteptr, .charptr {
// primitive types // primitive types
res = sym.kind.str() res = sym.kind.str()
} }