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

cmd/v: error-limit

This commit is contained in:
Alexander Medvednikov 2020-05-24 04:47:51 +02:00
parent 67750c91d7
commit 85d19dd253
3 changed files with 11 additions and 5 deletions

View File

@ -45,7 +45,13 @@ pub fn new_builder(pref &pref.Preferences) Builder {
parent: 0
}
compiled_dir: compiled_dir
max_nr_errors: if pref.error_limit > 0 {
pref.error_limit
} else {
100
}
}
// max_nr_errors: pref.error_limit ?? 100 TODO potential syntax?
}
// parse all deps from already parsed files

View File

@ -236,9 +236,9 @@ fn (mut g Gen) fn_args(args []table.Arg, is_variadic bool) ([]string, []string)
caname := c_name(arg.name)
arg_type_sym := g.table.get_type_symbol(arg.typ)
mut arg_type_name := g.typ(arg.typ) // arg_type_sym.name.replace('.', '__')
if arg.name == 'xxx' {
println('! ' + arg_type_name)
}
// if arg.name == 'xxx' {
// println('! ' + arg_type_name)
// }
is_varg := i == args.len - 1 && is_variadic
if is_varg {
varg_type_str := int(arg.typ).str()
@ -269,7 +269,7 @@ fn (mut g Gen) fn_args(args []table.Arg, is_variadic bool) ([]string, []string)
fargtypes << arg_type_name
} else {
mut nr_muls := arg.typ.nr_muls()
s := arg_type_name + '/*F*/ ' + caname
s := arg_type_name + ' ' + caname
if arg.is_mut {
// mut arg needs one *
nr_muls = 1

View File

@ -203,7 +203,7 @@ pub fn parse_args(args []string) (&Preferences, string) {
res.print_v_files = true
}
'-error-limit' {
res.error_limit =cmdline.option(current_args, '-error-limit', '0').int()
res.error_limit =cmdline.option(current_args, '-error-limit', '0').int()
}
'-os' {
target_os := cmdline.option(current_args, '-os', '')