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

cgen: treat the main module like any other v module

This commit is contained in:
Delyan Angelov
2020-07-01 01:53:53 +03:00
committed by GitHub
parent 81e4d3fd09
commit 78e1127d99
53 changed files with 720 additions and 535 deletions

View File

@ -1369,7 +1369,11 @@ pub fn (s string) fields() []string {
}
pub fn (s string) map(func fn(byte) byte) string {
return string(s.bytes().map(func(it)))
mut res := malloc(s.len + 1)
for i in 0..s.len {
res[i] = func(s[i])
}
return tos(res, s.len)
}
// Allows multi-line strings to be formatted in a way that removes white-space