From 563e8ba06913f0c6a7df42e1c379162f902f9570 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch
Date: Wed, 10 Oct 2018 19:49:17 +0200 Subject: Go: store scopes and globals as maps --- cmd/repl/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cmd/repl/main.go') diff --git a/cmd/repl/main.go b/cmd/repl/main.go index 098452d..b1bb413 100644 --- a/cmd/repl/main.go +++ b/cmd/repl/main.go @@ -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) } -- cgit v1.2.3-70-g09d2