mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: support ctags with -print_v_files and .ctags.d/v.ctags
This commit is contained in:
@@ -82,6 +82,13 @@ pub fn (mut b Builder) parse_imports() {
|
||||
}
|
||||
}
|
||||
b.resolve_deps()
|
||||
//
|
||||
if b.pref.print_v_files {
|
||||
for p in b.parsed_files {
|
||||
println(p.path)
|
||||
}
|
||||
exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn (mut b Builder) resolve_deps() {
|
||||
|
||||
@@ -33,10 +33,11 @@ pub fn (mut b Builder) gen_c(v_files []string) string {
|
||||
pub fn (mut b Builder) build_c(v_files []string, out_file string) {
|
||||
b.out_name_c = out_file
|
||||
b.info('build_c($out_file)')
|
||||
output := b.gen_c(v_files)
|
||||
mut f := os.create(out_file) or {
|
||||
panic(err)
|
||||
}
|
||||
f.writeln(b.gen_c(v_files))
|
||||
f.writeln(output)
|
||||
f.close()
|
||||
// os.write_file(out_file, b.gen_c(v_files))
|
||||
}
|
||||
|
||||
@@ -29,10 +29,11 @@ pub fn (mut b Builder) gen_js(v_files []string) string {
|
||||
pub fn (mut b Builder) build_js(v_files []string, out_file string) {
|
||||
b.out_name_js = out_file
|
||||
b.info('build_js($out_file)')
|
||||
output := b.gen_js(v_files)
|
||||
mut f := os.create(out_file) or {
|
||||
panic(err)
|
||||
}
|
||||
f.writeln(b.gen_js(v_files))
|
||||
f.writeln(output)
|
||||
f.close()
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ pub mut:
|
||||
mod string
|
||||
run_args []string // `v run x.v 1 2 3` => `1 2 3`
|
||||
printfn_list []string // a list of generated function names, whose source should be shown, for debugging
|
||||
print_v_files bool // when true, just print the list of all parsed .v files then stop.
|
||||
}
|
||||
|
||||
pub fn backend_from_string(s string) ?Backend {
|
||||
|
||||
Reference in New Issue
Block a user