Temporarily fix the builtin namespace.

This commit is contained in:
Qi Xiao 2016-02-23 00:10:00 +01:00
parent cffc728530
commit 3a237c3a4f

View File

@ -72,7 +72,13 @@ func NewEvaler(st *store.Store) *Evaler {
builtin[FnPrefix+b.Name] = NewRoVariable(b) builtin[FnPrefix+b.Name] = NewRoVariable(b)
} }
return &Evaler{builtin, Namespace{}, map[string]Namespace{}, st, nil, nil} // XXX Temporary fix for compiler not knowing builtin namespace.
global := Namespace{}
for k, v := range builtin {
global[k] = v
}
return &Evaler{builtin, global, map[string]Namespace{}, st, nil, nil}
} }
func (e *Evaler) searchPaths() []string { func (e *Evaler) searchPaths() []string {