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

make function arguments immutable by default

This commit is contained in:
Alexander Medvednikov
2019-08-07 08:19:27 +02:00
parent 06b8bd9382
commit 34e0b164eb
22 changed files with 107 additions and 83 deletions

View File

@ -7,7 +7,8 @@ module main
import strings
// fmt helpers
fn (scanner mut Scanner) fgen(s string) {
fn (scanner mut Scanner) fgen(s_ string) {
mut s := s_
if scanner.fmt_line_empty {
s = strings.repeat(`\t`, scanner.fmt_indent) + s
}
@ -15,7 +16,8 @@ fn (scanner mut Scanner) fgen(s string) {
scanner.fmt_line_empty = false
}
fn (scanner mut Scanner) fgenln(s string) {
fn (scanner mut Scanner) fgenln(s_ string) {
mut s := s_
if scanner.fmt_line_empty {
s = strings.repeat(`\t`, scanner.fmt_indent) + s
}