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

StringsBuilder => strings.Builder; strings.repeat()

This commit is contained in:
Alexander Medvednikov
2019-07-03 22:11:27 +02:00
parent e35ff0533b
commit 5d4d3b838b
10 changed files with 61 additions and 30 deletions

View File

@ -839,7 +839,7 @@ fn (p mut Parser) get_type() string {
p.error('unknown type `$typ`')
}
if mul {
typ += repeat_char(`*`, nr_muls)
typ += strings.repeat(`*`, nr_muls)
}
// Register an []array type
if is_arr2 {
@ -3175,7 +3175,7 @@ fn (p &Parser) building_v() bool {
// fmt helpers
fn (scanner mut Scanner) fgen(s string) {
if scanner.fmt_line_empty {
s = repeat_char(`\t`, scanner.fmt_indent) + s
s = strings.repeat(`\t`, scanner.fmt_indent) + s
}
scanner.fmt_out.write(s)
scanner.fmt_line_empty = false
@ -3183,7 +3183,7 @@ fn (scanner mut Scanner) fgen(s string) {
fn (scanner mut Scanner) fgenln(s string) {
if scanner.fmt_line_empty {
s = repeat_char(`\t`, scanner.fmt_indent) + s
s = strings.repeat(`\t`, scanner.fmt_indent) + s
}
scanner.fmt_out.writeln(s)
scanner.fmt_line_empty = true