pref: add -check-syntax for just parsing files, without checking them
parent
b5b5176f9b
commit
f1fdafcdff
|
@ -13,6 +13,9 @@ pub fn (mut b Builder) gen_c(v_files []string) string {
|
|||
t1 := time.ticks()
|
||||
parse_time := t1 - t0
|
||||
b.info('PARSE: ${parse_time}ms')
|
||||
if b.pref.only_check_syntax {
|
||||
return ''
|
||||
}
|
||||
//
|
||||
b.generic_struct_insts_to_concrete()
|
||||
b.checker.check_files(b.parsed_files)
|
||||
|
|
|
@ -76,6 +76,12 @@ fn (mut v Builder) cc() {
|
|||
if v.pref.is_verbose {
|
||||
println('builder.cc() pref.out_name="$v.pref.out_name"')
|
||||
}
|
||||
if v.pref.only_check_syntax {
|
||||
if v.pref.is_verbose {
|
||||
println('builder.cc returning early, since pref.only_check_syntax is true')
|
||||
}
|
||||
return
|
||||
}
|
||||
v.build_thirdparty_obj_files()
|
||||
vexe := pref.vexe_path()
|
||||
vdir := os.dir(vexe)
|
||||
|
|
|
@ -115,6 +115,7 @@ pub mut:
|
|||
is_parallel bool
|
||||
error_limit int
|
||||
is_vweb bool // skip _ var warning in templates
|
||||
only_check_syntax bool // when true, just parse the files, then stop, before running checker
|
||||
}
|
||||
|
||||
pub fn parse_args(args []string) (&Preferences, string) {
|
||||
|
@ -126,6 +127,9 @@ pub fn parse_args(args []string) (&Preferences, string) {
|
|||
arg := args[i]
|
||||
current_args := args[i..]
|
||||
match arg {
|
||||
'-check-syntax' {
|
||||
res.only_check_syntax = true
|
||||
}
|
||||
'-v' {
|
||||
res.is_verbose = true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue