builder: add 'builtin' to builtin_module_parts instead of .clone()
parent
b2428290f9
commit
05177b9dcb
|
@ -18,13 +18,13 @@ pub:
|
|||
mut:
|
||||
checker checker.Checker
|
||||
pref &pref.Preferences
|
||||
parsed_files []ast.File
|
||||
global_scope &ast.Scope
|
||||
out_name_c string
|
||||
out_name_js string
|
||||
max_nr_errors int = 100
|
||||
pub mut:
|
||||
module_search_paths []string
|
||||
parsed_files []ast.File
|
||||
}
|
||||
|
||||
pub fn new_builder(pref &pref.Preferences) Builder {
|
||||
|
@ -142,8 +142,7 @@ pub fn (mut b Builder) resolve_deps() {
|
|||
|
||||
// graph of all imported modules
|
||||
pub fn (b &Builder) import_graph() &depgraph.DepGraph {
|
||||
mut builtins := util.builtin_module_parts.clone()
|
||||
builtins << 'builtin'
|
||||
builtins := util.builtin_module_parts
|
||||
mut graph := depgraph.new_dep_graph()
|
||||
for p in b.parsed_files {
|
||||
mut deps := []string{}
|
||||
|
|
|
@ -156,6 +156,10 @@ Did you forget to add vlib to the path? (Use @vlib for default vlib)')
|
|||
}
|
||||
|
||||
pub fn (v Builder) get_user_files() []string {
|
||||
if v.pref.path == 'vlib/builtin' {
|
||||
// get_builtin_files() has already added the builtin files:
|
||||
return []
|
||||
}
|
||||
mut dir := v.pref.path
|
||||
v.log('get_v_files($dir)')
|
||||
// Need to store user files separately, because they have to be added after
|
||||
|
|
|
@ -12,7 +12,7 @@ pub const (
|
|||
|
||||
// math.bits is needed by strconv.ftoa
|
||||
pub const (
|
||||
builtin_module_parts = ['math.bits', 'strconv', 'strconv.ftoa', 'hash.wyhash', 'strings']
|
||||
builtin_module_parts = ['math.bits', 'strconv', 'strconv.ftoa', 'hash.wyhash', 'strings', 'builtin']
|
||||
)
|
||||
|
||||
pub const (
|
||||
|
|
Loading…
Reference in New Issue