Go: store scopes and globals as maps

This commit is contained in:
2018-10-10 19:49:17 +02:00
parent b210216c71
commit 563e8ba069
2 changed files with 18 additions and 33 deletions

View File

@@ -48,8 +48,7 @@ func complete(L *ell.Ell, line string, pos int) (
head, line = line[:lastSpace+1], line[lastSpace+1:]
}
for _, v := range L.Globals {
name := v.List[0].String
for name := range L.Globals {
if strings.HasPrefix(strings.ToLower(name), line) {
completions = append(completions, name)
}