mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builder: use verror for not found modules
This commit is contained in:
parent
74005b4362
commit
70b76a8e31
@ -67,12 +67,13 @@ pub fn (mut b Builder) parse_imports() {
|
||||
// break
|
||||
// println('module_search_paths:')
|
||||
// println(b.module_search_paths)
|
||||
panic('cannot import module "$mod" (not found)')
|
||||
verror('cannot import module "$mod" (not found)')
|
||||
break
|
||||
}
|
||||
v_files := b.v_files_from_dir(import_path)
|
||||
if v_files.len == 0 {
|
||||
// v.parsers[i].error_with_token_index('cannot import module "$mod" (no .v files in "$import_path")', v.parsers[i].import_table.get_import_tok_idx(mod))
|
||||
panic('cannot import module "$mod" (no .v files in "$import_path")')
|
||||
verror('cannot import module "$mod" (no .v files in "$import_path")')
|
||||
}
|
||||
// Add all imports referenced by these libs
|
||||
parsed_files := parser.parse_files(v_files, b.table, b.pref, b.global_scope)
|
||||
|
1
vlib/v/checker/tests/import_not_found_err.out
Normal file
1
vlib/v/checker/tests/import_not_found_err.out
Normal file
@ -0,0 +1 @@
|
||||
builder error: cannot import module "notexist" (not found)
|
4
vlib/v/checker/tests/import_not_found_err.vv
Normal file
4
vlib/v/checker/tests/import_not_found_err.vv
Normal file
@ -0,0 +1,4 @@
|
||||
import notexist
|
||||
fn main() {
|
||||
println('hello, world')
|
||||
}
|
Loading…
Reference in New Issue
Block a user