From 4594d78bd67ce3fd62d64b5822ccfbfc67dda38e Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 29 Jun 2019 11:54:29 +0200 Subject: [PATCH] move all vlib modules to vlib/ --- compiler/main.v | 11 ++++++----- {base64 => vlib/base64}/base64.v | 0 {base64 => vlib/base64}/base64_test.v | 0 {builtin => vlib/builtin}/array.v | 0 {builtin => vlib/builtin}/array_test.v | 0 {builtin => vlib/builtin}/builtin.v | 0 {builtin => vlib/builtin}/int.v | 0 {builtin => vlib/builtin}/map.v | 0 {builtin => vlib/builtin}/option.v | 0 {builtin => vlib/builtin}/string.v | 0 {builtin => vlib/builtin}/string_builder.v | 0 {builtin => vlib/builtin}/string_test.v | 0 {builtin => vlib/builtin}/utf8.v | 0 {examples => vlib/examples}/.gitignore | 0 {examples => vlib/examples}/VCasino/.gitignore | 0 {examples => vlib/examples}/VCasino/README.md | 0 {examples => vlib/examples}/VCasino/VCasino.v | 0 {examples => vlib/examples}/game_of_life/.gitignore | 0 {examples => vlib/examples}/game_of_life/README.md | 0 {examples => vlib/examples}/game_of_life/demo.gif | Bin {examples => vlib/examples}/game_of_life/life.v | 0 {examples => vlib/examples}/hello_world.v | 0 {examples => vlib/examples}/json.v | 0 {examples => vlib/examples}/links_scraper.v | 0 {examples => vlib/examples}/log.v | 0 {examples => vlib/examples}/news_fetcher.v | 0 {examples => vlib/examples}/tetris/.gitignore | 0 {examples => vlib/examples}/tetris/README.md | 0 .../examples}/tetris/RobotoMono-Regular.ttf | Bin {examples => vlib/examples}/tetris/screenshot.png | Bin {examples => vlib/examples}/tetris/tetris.v | 0 {examples => vlib/examples}/word_counter/.gitignore | 0 {examples => vlib/examples}/word_counter/README.md | 0 .../examples}/word_counter/cinderella.txt | 0 .../examples}/word_counter/word_counter.v | 0 {gg => vlib/gg}/README.md | 0 {gg => vlib/gg}/gg.v | 0 {gl => vlib/gl}/1shader.v | 0 {gl => vlib/gl}/gl.v | 0 {glfw => vlib/glfw}/glfw.v | 0 {glm => vlib/glm}/glm.v | 0 {glm => vlib/glm}/glm_test.v | 0 {gx => vlib/gx}/gx.v | 0 {http => vlib/http}/download_mac.v | 0 {http => vlib/http}/download_win.v | 0 {http => vlib/http}/http.v | 0 {http => vlib/http}/http_mac.v | 0 {http => vlib/http}/http_win.v | 0 {json => vlib/json}/json_primitives.v | 0 {json => vlib/json}/json_test.v | 0 {log => vlib/log}/log.v | 0 {math => vlib/math}/math.v | 0 {os => vlib/os}/os.v | 0 {os => vlib/os}/os_mac.v | 0 {os => vlib/os}/os_test.v | 0 {os => vlib/os}/os_win.v | 0 {rand => vlib/rand}/rand.v | 0 {stbi => vlib/stbi}/stbi.v | 0 {sync => vlib/sync}/sync_mac.v | 0 {sync => vlib/sync}/sync_win.v | 0 {termcolor => vlib/termcolor}/colors.v | 0 {time => vlib/time}/time.v | 0 62 files changed, 6 insertions(+), 5 deletions(-) rename {base64 => vlib/base64}/base64.v (100%) rename {base64 => vlib/base64}/base64_test.v (100%) rename {builtin => vlib/builtin}/array.v (100%) rename {builtin => vlib/builtin}/array_test.v (100%) rename {builtin => vlib/builtin}/builtin.v (100%) rename {builtin => vlib/builtin}/int.v (100%) rename {builtin => vlib/builtin}/map.v (100%) rename {builtin => vlib/builtin}/option.v (100%) rename {builtin => vlib/builtin}/string.v (100%) rename {builtin => vlib/builtin}/string_builder.v (100%) rename {builtin => vlib/builtin}/string_test.v (100%) rename {builtin => vlib/builtin}/utf8.v (100%) rename {examples => vlib/examples}/.gitignore (100%) rename {examples => vlib/examples}/VCasino/.gitignore (100%) rename {examples => vlib/examples}/VCasino/README.md (100%) rename {examples => vlib/examples}/VCasino/VCasino.v (100%) rename {examples => vlib/examples}/game_of_life/.gitignore (100%) rename {examples => vlib/examples}/game_of_life/README.md (100%) rename {examples => vlib/examples}/game_of_life/demo.gif (100%) rename {examples => vlib/examples}/game_of_life/life.v (100%) rename {examples => vlib/examples}/hello_world.v (100%) rename {examples => vlib/examples}/json.v (100%) rename {examples => vlib/examples}/links_scraper.v (100%) rename {examples => vlib/examples}/log.v (100%) rename {examples => vlib/examples}/news_fetcher.v (100%) rename {examples => vlib/examples}/tetris/.gitignore (100%) rename {examples => vlib/examples}/tetris/README.md (100%) rename {examples => vlib/examples}/tetris/RobotoMono-Regular.ttf (100%) rename {examples => vlib/examples}/tetris/screenshot.png (100%) rename {examples => vlib/examples}/tetris/tetris.v (100%) rename {examples => vlib/examples}/word_counter/.gitignore (100%) rename {examples => vlib/examples}/word_counter/README.md (100%) rename {examples => vlib/examples}/word_counter/cinderella.txt (100%) rename {examples => vlib/examples}/word_counter/word_counter.v (100%) rename {gg => vlib/gg}/README.md (100%) rename {gg => vlib/gg}/gg.v (100%) rename {gl => vlib/gl}/1shader.v (100%) rename {gl => vlib/gl}/gl.v (100%) rename {glfw => vlib/glfw}/glfw.v (100%) rename {glm => vlib/glm}/glm.v (100%) rename {glm => vlib/glm}/glm_test.v (100%) rename {gx => vlib/gx}/gx.v (100%) rename {http => vlib/http}/download_mac.v (100%) rename {http => vlib/http}/download_win.v (100%) rename {http => vlib/http}/http.v (100%) rename {http => vlib/http}/http_mac.v (100%) rename {http => vlib/http}/http_win.v (100%) rename {json => vlib/json}/json_primitives.v (100%) rename {json => vlib/json}/json_test.v (100%) rename {log => vlib/log}/log.v (100%) rename {math => vlib/math}/math.v (100%) rename {os => vlib/os}/os.v (100%) rename {os => vlib/os}/os_mac.v (100%) rename {os => vlib/os}/os_test.v (100%) rename {os => vlib/os}/os_win.v (100%) rename {rand => vlib/rand}/rand.v (100%) rename {stbi => vlib/stbi}/stbi.v (100%) rename {sync => vlib/sync}/sync_mac.v (100%) rename {sync => vlib/sync}/sync_win.v (100%) rename {termcolor => vlib/termcolor}/colors.v (100%) rename {time => vlib/time}/time.v (100%) diff --git a/compiler/main.v b/compiler/main.v index 0f9e05d9e9..5c4f36abae 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -632,7 +632,7 @@ fn (c mut V) add_user_v_files() { for i := 0; i < c.table.imports.len; i++ { pkg := c.table.imports[i] // 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 for file in vfiles { 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 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 // TmpPath/vlib // These were generated by vfmt @@ -776,7 +776,7 @@ fn new_v(args[]string) *V { break } 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 } } @@ -790,11 +790,12 @@ fn new_v(args[]string) *V { // from "v/compiler" cur_dir := os.getwd() 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".') os.write_file(TmpPath + '/VROOT', lang_dir) } else { println('V repo not found. Cloning...') +exit(1) os.mv('v', 'v.bin') os.exec('git clone https://github.com/vlang/v') if !os.dir_exists('v') { @@ -811,7 +812,7 @@ fn new_v(args[]string) *V { // Add builtin files if !out_name.contains('builtin.o') { 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 if build_mode == DEFAULT_MODE || build_mode == BUILD { f = '$TmpPath/vlib/builtin/${builtin}h' diff --git a/base64/base64.v b/vlib/base64/base64.v similarity index 100% rename from base64/base64.v rename to vlib/base64/base64.v diff --git a/base64/base64_test.v b/vlib/base64/base64_test.v similarity index 100% rename from base64/base64_test.v rename to vlib/base64/base64_test.v diff --git a/builtin/array.v b/vlib/builtin/array.v similarity index 100% rename from builtin/array.v rename to vlib/builtin/array.v diff --git a/builtin/array_test.v b/vlib/builtin/array_test.v similarity index 100% rename from builtin/array_test.v rename to vlib/builtin/array_test.v diff --git a/builtin/builtin.v b/vlib/builtin/builtin.v similarity index 100% rename from builtin/builtin.v rename to vlib/builtin/builtin.v diff --git a/builtin/int.v b/vlib/builtin/int.v similarity index 100% rename from builtin/int.v rename to vlib/builtin/int.v diff --git a/builtin/map.v b/vlib/builtin/map.v similarity index 100% rename from builtin/map.v rename to vlib/builtin/map.v diff --git a/builtin/option.v b/vlib/builtin/option.v similarity index 100% rename from builtin/option.v rename to vlib/builtin/option.v diff --git a/builtin/string.v b/vlib/builtin/string.v similarity index 100% rename from builtin/string.v rename to vlib/builtin/string.v diff --git a/builtin/string_builder.v b/vlib/builtin/string_builder.v similarity index 100% rename from builtin/string_builder.v rename to vlib/builtin/string_builder.v diff --git a/builtin/string_test.v b/vlib/builtin/string_test.v similarity index 100% rename from builtin/string_test.v rename to vlib/builtin/string_test.v diff --git a/builtin/utf8.v b/vlib/builtin/utf8.v similarity index 100% rename from builtin/utf8.v rename to vlib/builtin/utf8.v diff --git a/examples/.gitignore b/vlib/examples/.gitignore similarity index 100% rename from examples/.gitignore rename to vlib/examples/.gitignore diff --git a/examples/VCasino/.gitignore b/vlib/examples/VCasino/.gitignore similarity index 100% rename from examples/VCasino/.gitignore rename to vlib/examples/VCasino/.gitignore diff --git a/examples/VCasino/README.md b/vlib/examples/VCasino/README.md similarity index 100% rename from examples/VCasino/README.md rename to vlib/examples/VCasino/README.md diff --git a/examples/VCasino/VCasino.v b/vlib/examples/VCasino/VCasino.v similarity index 100% rename from examples/VCasino/VCasino.v rename to vlib/examples/VCasino/VCasino.v diff --git a/examples/game_of_life/.gitignore b/vlib/examples/game_of_life/.gitignore similarity index 100% rename from examples/game_of_life/.gitignore rename to vlib/examples/game_of_life/.gitignore diff --git a/examples/game_of_life/README.md b/vlib/examples/game_of_life/README.md similarity index 100% rename from examples/game_of_life/README.md rename to vlib/examples/game_of_life/README.md diff --git a/examples/game_of_life/demo.gif b/vlib/examples/game_of_life/demo.gif similarity index 100% rename from examples/game_of_life/demo.gif rename to vlib/examples/game_of_life/demo.gif diff --git a/examples/game_of_life/life.v b/vlib/examples/game_of_life/life.v similarity index 100% rename from examples/game_of_life/life.v rename to vlib/examples/game_of_life/life.v diff --git a/examples/hello_world.v b/vlib/examples/hello_world.v similarity index 100% rename from examples/hello_world.v rename to vlib/examples/hello_world.v diff --git a/examples/json.v b/vlib/examples/json.v similarity index 100% rename from examples/json.v rename to vlib/examples/json.v diff --git a/examples/links_scraper.v b/vlib/examples/links_scraper.v similarity index 100% rename from examples/links_scraper.v rename to vlib/examples/links_scraper.v diff --git a/examples/log.v b/vlib/examples/log.v similarity index 100% rename from examples/log.v rename to vlib/examples/log.v diff --git a/examples/news_fetcher.v b/vlib/examples/news_fetcher.v similarity index 100% rename from examples/news_fetcher.v rename to vlib/examples/news_fetcher.v diff --git a/examples/tetris/.gitignore b/vlib/examples/tetris/.gitignore similarity index 100% rename from examples/tetris/.gitignore rename to vlib/examples/tetris/.gitignore diff --git a/examples/tetris/README.md b/vlib/examples/tetris/README.md similarity index 100% rename from examples/tetris/README.md rename to vlib/examples/tetris/README.md diff --git a/examples/tetris/RobotoMono-Regular.ttf b/vlib/examples/tetris/RobotoMono-Regular.ttf similarity index 100% rename from examples/tetris/RobotoMono-Regular.ttf rename to vlib/examples/tetris/RobotoMono-Regular.ttf diff --git a/examples/tetris/screenshot.png b/vlib/examples/tetris/screenshot.png similarity index 100% rename from examples/tetris/screenshot.png rename to vlib/examples/tetris/screenshot.png diff --git a/examples/tetris/tetris.v b/vlib/examples/tetris/tetris.v similarity index 100% rename from examples/tetris/tetris.v rename to vlib/examples/tetris/tetris.v diff --git a/examples/word_counter/.gitignore b/vlib/examples/word_counter/.gitignore similarity index 100% rename from examples/word_counter/.gitignore rename to vlib/examples/word_counter/.gitignore diff --git a/examples/word_counter/README.md b/vlib/examples/word_counter/README.md similarity index 100% rename from examples/word_counter/README.md rename to vlib/examples/word_counter/README.md diff --git a/examples/word_counter/cinderella.txt b/vlib/examples/word_counter/cinderella.txt similarity index 100% rename from examples/word_counter/cinderella.txt rename to vlib/examples/word_counter/cinderella.txt diff --git a/examples/word_counter/word_counter.v b/vlib/examples/word_counter/word_counter.v similarity index 100% rename from examples/word_counter/word_counter.v rename to vlib/examples/word_counter/word_counter.v diff --git a/gg/README.md b/vlib/gg/README.md similarity index 100% rename from gg/README.md rename to vlib/gg/README.md diff --git a/gg/gg.v b/vlib/gg/gg.v similarity index 100% rename from gg/gg.v rename to vlib/gg/gg.v diff --git a/gl/1shader.v b/vlib/gl/1shader.v similarity index 100% rename from gl/1shader.v rename to vlib/gl/1shader.v diff --git a/gl/gl.v b/vlib/gl/gl.v similarity index 100% rename from gl/gl.v rename to vlib/gl/gl.v diff --git a/glfw/glfw.v b/vlib/glfw/glfw.v similarity index 100% rename from glfw/glfw.v rename to vlib/glfw/glfw.v diff --git a/glm/glm.v b/vlib/glm/glm.v similarity index 100% rename from glm/glm.v rename to vlib/glm/glm.v diff --git a/glm/glm_test.v b/vlib/glm/glm_test.v similarity index 100% rename from glm/glm_test.v rename to vlib/glm/glm_test.v diff --git a/gx/gx.v b/vlib/gx/gx.v similarity index 100% rename from gx/gx.v rename to vlib/gx/gx.v diff --git a/http/download_mac.v b/vlib/http/download_mac.v similarity index 100% rename from http/download_mac.v rename to vlib/http/download_mac.v diff --git a/http/download_win.v b/vlib/http/download_win.v similarity index 100% rename from http/download_win.v rename to vlib/http/download_win.v diff --git a/http/http.v b/vlib/http/http.v similarity index 100% rename from http/http.v rename to vlib/http/http.v diff --git a/http/http_mac.v b/vlib/http/http_mac.v similarity index 100% rename from http/http_mac.v rename to vlib/http/http_mac.v diff --git a/http/http_win.v b/vlib/http/http_win.v similarity index 100% rename from http/http_win.v rename to vlib/http/http_win.v diff --git a/json/json_primitives.v b/vlib/json/json_primitives.v similarity index 100% rename from json/json_primitives.v rename to vlib/json/json_primitives.v diff --git a/json/json_test.v b/vlib/json/json_test.v similarity index 100% rename from json/json_test.v rename to vlib/json/json_test.v diff --git a/log/log.v b/vlib/log/log.v similarity index 100% rename from log/log.v rename to vlib/log/log.v diff --git a/math/math.v b/vlib/math/math.v similarity index 100% rename from math/math.v rename to vlib/math/math.v diff --git a/os/os.v b/vlib/os/os.v similarity index 100% rename from os/os.v rename to vlib/os/os.v diff --git a/os/os_mac.v b/vlib/os/os_mac.v similarity index 100% rename from os/os_mac.v rename to vlib/os/os_mac.v diff --git a/os/os_test.v b/vlib/os/os_test.v similarity index 100% rename from os/os_test.v rename to vlib/os/os_test.v diff --git a/os/os_win.v b/vlib/os/os_win.v similarity index 100% rename from os/os_win.v rename to vlib/os/os_win.v diff --git a/rand/rand.v b/vlib/rand/rand.v similarity index 100% rename from rand/rand.v rename to vlib/rand/rand.v diff --git a/stbi/stbi.v b/vlib/stbi/stbi.v similarity index 100% rename from stbi/stbi.v rename to vlib/stbi/stbi.v diff --git a/sync/sync_mac.v b/vlib/sync/sync_mac.v similarity index 100% rename from sync/sync_mac.v rename to vlib/sync/sync_mac.v diff --git a/sync/sync_win.v b/vlib/sync/sync_win.v similarity index 100% rename from sync/sync_win.v rename to vlib/sync/sync_win.v diff --git a/termcolor/colors.v b/vlib/termcolor/colors.v similarity index 100% rename from termcolor/colors.v rename to vlib/termcolor/colors.v diff --git a/time/time.v b/vlib/time/time.v similarity index 100% rename from time/time.v rename to vlib/time/time.v