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

use mod var

This commit is contained in:
Joe Conigliaro 2019-07-27 07:36:22 +10:00 committed by Alexander Medvednikov
parent 7b95f09f86
commit 3850227b46

View File

@ -920,7 +920,7 @@ fn (v mut V) add_user_v_files() {
if v.pref.build_mode == .default_mode { if v.pref.build_mode == .default_mode {
for i := 0; i < v.table.imports.len; i++ { for i := 0; i < v.table.imports.len; i++ {
mod := v.table.imports[i] mod := v.table.imports[i]
mod_path := v.module_path(v.table.imports[i]) mod_path := v.module_path(mod)
vfiles := v.v_files_from_dir('$ModPath/vlib/$mod_path') vfiles := v.v_files_from_dir('$ModPath/vlib/$mod_path')
if vfiles.len == 0 { if vfiles.len == 0 {
panic('cannot import module $mod, it does not exist.') panic('cannot import module $mod, it does not exist.')
@ -938,7 +938,7 @@ fn (v mut V) add_user_v_files() {
// for mod in v.table.imports { // for mod in v.table.imports {
for i := 0; i < v.table.imports.len; i++ { for i := 0; i < v.table.imports.len; i++ {
mod := v.table.imports[i] mod := v.table.imports[i]
mod_path := v.module_path(v.table.imports[i]) mod_path := v.module_path(mod)
idir := os.getwd() idir := os.getwd()
mut import_path := '$idir/$mod_path' mut import_path := '$idir/$mod_path'
if !os.file_exists(import_path) { if !os.file_exists(import_path) {