aboutsummaryrefslogtreecommitdiff
path: root/cmd/repl
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-10-10 19:39:29 +0200
committerPřemysl Janouch <p@janouch.name>2018-10-10 19:39:29 +0200
commitb210216c711de9043964313662677dff513fde1d (patch)
treeb82bc3419c69444f39d1f9219d6398769cfbc2bd /cmd/repl
parentfb143f4d2772780b1f681200729443fcb8f03d39 (diff)
downloadell-b210216c711de9043964313662677dff513fde1d.tar.gz
ell-b210216c711de9043964313662677dff513fde1d.tar.xz
ell-b210216c711de9043964313662677dff513fde1d.zip
Go: use slices for list values
Diffstat (limited to 'cmd/repl')
-rw-r--r--cmd/repl/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/repl/main.go b/cmd/repl/main.go
index 6d1f421..098452d 100644
--- a/cmd/repl/main.go
+++ b/cmd/repl/main.go
@@ -28,8 +28,8 @@ import (
"janouch.name/ell/ell"
)
-func run(L *ell.Ell, program *ell.V) {
- var result *ell.V
+func run(L *ell.Ell, program []ell.V) {
+ var result []ell.V
if !L.EvalBlock(program, nil, &result) {
fmt.Printf("\x1b[31m%s: %s\x1b[0m\n", "runtime error", L.Error)
L.Error = ""
@@ -48,8 +48,8 @@ func complete(L *ell.Ell, line string, pos int) (
head, line = line[:lastSpace+1], line[lastSpace+1:]
}
- for v := L.Globals; v != nil; v = v.Next {
- name := v.Head.String
+ for _, v := range L.Globals {
+ name := v.List[0].String
if strings.HasPrefix(strings.ToLower(name), line) {
completions = append(completions, name)
}