From f91bded9b3f1854784fc86299e1e4e0a75e2218d Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Wed, 19 Feb 2020 13:11:55 +1100 Subject: [PATCH] v2: add missing table/modules.v --- vlib/v/table/modules.v | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vlib/v/table/modules.v diff --git a/vlib/v/table/modules.v b/vlib/v/table/modules.v new file mode 100644 index 0000000000..e79dbe550a --- /dev/null +++ b/vlib/v/table/modules.v @@ -0,0 +1,20 @@ +module table + +import os + +// Once we have a module format we can read from module file instead +// this is not optimal +pub fn (table &Table) qualify_module(mod string, file_path string) string { + for m in table.imports { + println('TABLE IMPORT: $m') + if m.contains('.') && m.contains(mod) { + m_parts := m.split('.') + m_path := m_parts.join(os.path_separator) + println('IMPORT B: $m - $m_path') + if mod == m_parts[m_parts.len - 1] && file_path.contains(m_path) { + return m + } + } + } + return mod +}