From 1086150ab907d9e733311fbb8818764da5727e8f Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Mon, 27 Jul 2020 12:06:48 +1000 Subject: [PATCH] builder: add comment to parse_imports `re: dup file parsing` --- vlib/v/builder/builder.v | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vlib/v/builder/builder.v b/vlib/v/builder/builder.v index e6649a22f0..24ab5ed0b7 100644 --- a/vlib/v/builder/builder.v +++ b/vlib/v/builder/builder.v @@ -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