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

v2: imports

This commit is contained in:
Alexander Medvednikov
2020-02-12 01:16:38 +01:00
parent 0ec5680156
commit d9cf98f772
5 changed files with 53 additions and 6 deletions

View File

@@ -19,7 +19,8 @@ pub mut:
fns map[string]Fn
consts map[string]Var
tmp_cnt int
imports []string
imports []string // List of all imports
modules []string // List of all modules registered by the application
}
pub struct Fn {
@@ -577,3 +578,13 @@ pub fn (t &Table) get_expr_typ(expr ast.Expr) TypeSymbol {
}
}
*/
pub fn (t &Table) known_import(name string) bool {
for i in t.imports {
if i.all_after('.') == name {
return true
}
}
return false
}