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

all: switch to the new fn arg syntax everywhere; add lots of vfmt -verify tests

This commit is contained in:
Alexander Medvednikov
2020-10-15 12:32:28 +02:00
parent 982056894e
commit 7da1afa140
37 changed files with 382 additions and 404 deletions

View File

@@ -228,7 +228,7 @@ fn module_path(mod string) string {
return mod.replace('.', os.path_separator)
}
pub fn (b &Builder) find_module_path(mod, fpath string) ?string {
pub fn (b &Builder) find_module_path(mod string, fpath string) ?string {
// support @VROOT/v.mod relative paths:
mut mcache := vmod.get_cache()
vmod_file_location := mcache.get_by_file(fpath)

View File

@@ -792,7 +792,7 @@ fn missing_compiler_info() string {
return ''
}
fn error_context_lines(text, keyword string, before, after int) []string {
fn error_context_lines(text string, keyword string, before int, after int) []string {
khighlight := if term.can_show_color_on_stdout() { term.red(keyword) } else { keyword }
mut eline_idx := 0
mut lines := text.split_into_lines()

View File

@@ -21,7 +21,7 @@ fn get_vtmp_folder() string {
return vtmp
}
fn get_vtmp_filename(base_file_name, postfix string) string {
fn get_vtmp_filename(base_file_name string, postfix string) string {
vtmp := get_vtmp_folder()
return os.real_path(os.join_path(vtmp, os.file_name(os.real_path(base_file_name)) + postfix))
}

View File

@@ -97,7 +97,7 @@ fn find_windows_kit_root(host_arch string) ?WindowsKit {
return error('Unable to find a windows kit')
}
kit_lib := kit_root + 'Lib'
files := os.ls(kit_lib)?
files := os.ls(kit_lib) ?
mut highest_path := ''
mut highest_int := 0
for f in files {
@@ -128,7 +128,7 @@ struct VsInstallation {
exe_path string
}
fn find_vs(vswhere_dir, host_arch string) ?VsInstallation {
fn find_vs(vswhere_dir string, host_arch string) ?VsInstallation {
$if !windows {
return error('Host OS does not support finding a Visual Studio installation')
}
@@ -136,7 +136,7 @@ fn find_vs(vswhere_dir, host_arch string) ?VsInstallation {
// VSWhere is guaranteed to be installed at this location now
// If its not there then end user needs to update their visual studio
// installation!
res := os.exec('"$vswhere_dir\\Microsoft Visual Studio\\Installer\\vswhere.exe" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath')?
res := os.exec('"$vswhere_dir\\Microsoft Visual Studio\\Installer\\vswhere.exe" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath') ?
res_output := res.output.trim_right('\r\n')
// println('res: "$res"')
version := os.read_file('$res_output\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt') or {