move all vlib modules to vlib/

pull/792/head
Alexander Medvednikov 2019-06-29 11:54:29 +02:00
parent bdcbcb075b
commit 4594d78bd6
62 changed files with 6 additions and 5 deletions

View File

@ -632,7 +632,7 @@ fn (c mut V) add_user_v_files() {
for i := 0; i < c.table.imports.len; i++ { for i := 0; i < c.table.imports.len; i++ {
pkg := c.table.imports[i] pkg := c.table.imports[i]
// mut import_path := '$c.lang_dir/$pkg' // mut import_path := '$c.lang_dir/$pkg'
vfiles := c.v_files_from_dir('$c.lang_dir/$pkg') vfiles := c.v_files_from_dir('$c.lang_dir/vlib/$pkg')
// Add all imports referenced by these libs // Add all imports referenced by these libs
for file in vfiles { for file in vfiles {
mut p := c.new_parser(file, RUN_IMPORTS) mut p := c.new_parser(file, RUN_IMPORTS)
@ -646,7 +646,7 @@ fn (c mut V) add_user_v_files() {
} }
// Only now add all combined lib files // Only now add all combined lib files
for pkg in c.table.imports { for pkg in c.table.imports {
mut module_path := '$c.lang_dir/$pkg' mut module_path := '$c.lang_dir/vlib/$pkg'
// If we are in default mode, we don't parse vlib .v files, but header .vh files in // If we are in default mode, we don't parse vlib .v files, but header .vh files in
// TmpPath/vlib // TmpPath/vlib
// These were generated by vfmt // These were generated by vfmt
@ -776,7 +776,7 @@ fn new_v(args[]string) *V {
break break
} }
vroot=vroot.trim_space() vroot=vroot.trim_space()
if os.dir_exists(vroot) && os.dir_exists(vroot + '/builtin') { if os.dir_exists(vroot) && os.dir_exists(vroot + '/vlib/builtin') {
lang_dir = vroot lang_dir = vroot
} }
} }
@ -790,11 +790,12 @@ fn new_v(args[]string) *V {
// from "v/compiler" // from "v/compiler"
cur_dir := os.getwd() cur_dir := os.getwd()
lang_dir = cur_dir.all_before_last('/') lang_dir = cur_dir.all_before_last('/')
if os.dir_exists('$lang_dir/builtin') { if os.dir_exists('$lang_dir/vlib/builtin') {
println('Setting VROOT to "$lang_dir".') println('Setting VROOT to "$lang_dir".')
os.write_file(TmpPath + '/VROOT', lang_dir) os.write_file(TmpPath + '/VROOT', lang_dir)
} else { } else {
println('V repo not found. Cloning...') println('V repo not found. Cloning...')
exit(1)
os.mv('v', 'v.bin') os.mv('v', 'v.bin')
os.exec('git clone https://github.com/vlang/v') os.exec('git clone https://github.com/vlang/v')
if !os.dir_exists('v') { if !os.dir_exists('v') {
@ -811,7 +812,7 @@ fn new_v(args[]string) *V {
// Add builtin files // Add builtin files
if !out_name.contains('builtin.o') { if !out_name.contains('builtin.o') {
for builtin in builtins { for builtin in builtins {
mut f := '$lang_dir/builtin/$builtin' mut f := '$lang_dir/vlib/builtin/$builtin'
// In default mode we use precompiled vlib.o, point to .vh files with signatures // In default mode we use precompiled vlib.o, point to .vh files with signatures
if build_mode == DEFAULT_MODE || build_mode == BUILD { if build_mode == DEFAULT_MODE || build_mode == BUILD {
f = '$TmpPath/vlib/builtin/${builtin}h' f = '$TmpPath/vlib/builtin/${builtin}h'

View File

Before

Width:  |  Height:  |  Size: 628 KiB

After

Width:  |  Height:  |  Size: 628 KiB

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB