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

v2: type checker + lots of other changes

This commit is contained in:
joe-conigliaro
2020-01-19 09:26:14 +11:00
committed by Alexander Medvednikov
parent 8c1b03c731
commit 09d1eb7c55
16 changed files with 893 additions and 546 deletions

View File

@ -8,11 +8,7 @@ import (
os.cmdline
strings
filepath
v.gen.x64
v.table
v.parser
v.gen
time
v.builder
)
pub const (
@ -390,29 +386,15 @@ pub fn (v mut V) compile2() {
println('all .v files before:')
println(v.files)
}
v.add_v_files_to_compile()
// v.add_v_files_to_compile()
v.files << v.dir
if v.pref.is_verbose {
println('all .v files:')
println(v.files)
}
table := table.new_table()
files := parser.parse_files(v.files, table)
c := gen.cgen(files, table)
println('out: $v.out_name_c')
os.write_file(v.out_name_c, c)
/*
cgen.genln(c_builtin_types)
if !v.pref.is_bare {
cgen.genln(c_headers)
}
else {
cgen.genln(bare_c_headers)
}
}
*/
mut b := builder.new_builder()
b.build_c(v.files, v.out_name)
v.cc()
}
pub fn (v mut V) compile_x64() {
@ -423,12 +405,8 @@ pub fn (v mut V) compile_x64() {
//v.files << v.v_files_from_dir(filepath.join(v.pref.vlib_path,'builtin','bare'))
v.files << v.dir
table := &table.new_table()
ticks := time.ticks()
files := parser.parse_files(v.files, table)
println('PARSE: ${time.ticks() - ticks}ms')
x64.gen(files, v.out_name)
println('x64 GEN: ${time.ticks() - ticks}ms')
mut b := builder.new_builder()
b.build_x64(v.files, v.out_name)
}
fn (v mut V) generate_init() {