From 85d19dd2532ac84bbe06ff5d8c8235c024d16068 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 24 May 2020 04:47:51 +0200 Subject: [PATCH] cmd/v: error-limit --- vlib/v/builder/builder.v | 6 ++++++ vlib/v/gen/fn.v | 8 ++++---- vlib/v/pref/pref.v | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/vlib/v/builder/builder.v b/vlib/v/builder/builder.v index c7f18691ff..fd515ee71c 100644 --- a/vlib/v/builder/builder.v +++ b/vlib/v/builder/builder.v @@ -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 diff --git a/vlib/v/gen/fn.v b/vlib/v/gen/fn.v index 3ae906b980..b6f73c7389 100644 --- a/vlib/v/gen/fn.v +++ b/vlib/v/gen/fn.v @@ -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 diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index aafaa0ea7a..82a3a82c9f 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -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', '')