builder: use verror for not found modules
parent
74005b4362
commit
70b76a8e31
|
@ -67,12 +67,13 @@ pub fn (mut b Builder) parse_imports() {
|
||||||
// break
|
// break
|
||||||
// println('module_search_paths:')
|
// println('module_search_paths:')
|
||||||
// println(b.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)
|
v_files := b.v_files_from_dir(import_path)
|
||||||
if v_files.len == 0 {
|
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))
|
// 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
|
// Add all imports referenced by these libs
|
||||||
parsed_files := parser.parse_files(v_files, b.table, b.pref, b.global_scope)
|
parsed_files := parser.parse_files(v_files, b.table, b.pref, b.global_scope)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
builder error: cannot import module "notexist" (not found)
|
|
@ -0,0 +1,4 @@
|
||||||
|
import notexist
|
||||||
|
fn main() {
|
||||||
|
println('hello, world')
|
||||||
|
}
|
Loading…
Reference in New Issue