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

builder: add comment to parse_imports re: dup file parsing

This commit is contained in:
joe-conigliaro 2020-07-27 12:06:48 +10:00
parent 3d19167628
commit 1086150ab9
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1

View File

@ -70,6 +70,17 @@ pub fn (mut b Builder) parse_imports() {
if b.pref.is_script {
done_imports << 'os'
}
// TODO (joe): decide if this is correct solution.
// in the case of building a module, the actual module files
// are passed via cmd line, so they have already been parsed
// by this stage. note that if one files from a module was
// parsed (but not all of them), then this will cause a problem.
// we could add a list of parsed files instead, but I think
// there is a better solution all around, I will revisit this.
// NOTE: there is a very similar occurance with the way
// internal module test's work, and this was the reason there
// were issues with duplicate declarations, so we should sort
// that out in a similar way.
for file in b.parsed_files {
if file.mod.name != 'main' && file.mod.name !in done_imports {
done_imports << file.mod.name