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

bugfix: v should not panic when encountering a file that consists only of comments

This commit is contained in:
Delyan Angelov
2020-02-20 23:59:47 +02:00
committed by GitHub
parent e56bf42270
commit 88b402fcf8
4 changed files with 12 additions and 1 deletions

View File

@ -828,7 +828,7 @@ pub fn (v mut V) parse_lib_imports() {
pidx := v.parse(file, .imports)
p_mod := v.parsers[pidx].mod
if p_mod != mod {
v.parsers[pidx].error_with_token_index('bad module definition: ${v.parsers[pidx].file_path} imports module "$mod" but $file is defined as module `$p_mod`', 1)
v.parsers[pidx].error_with_token_index('bad module definition: ${v.parsers[pidx].file_path} imports module "$mod" but $file is defined as module `$p_mod`', 0)
}
}
done_imports << mod