aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-24 01:59:13 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-24 01:59:13 +0100
commit565751db4e5b8370c0a05d1998a91e6e20a19bb4 (patch)
tree59ab8649b3e01da4c61a6f70269aaddacdf2eba9 /cmd
parent07584da73461b69043451ebe48fcac226202492a (diff)
remove context
Diffstat (limited to 'cmd')
-rw-r--r--cmd/eval/main.go10
-rw-r--r--cmd/j1e/main.go10
2 files changed, 8 insertions, 12 deletions
diff --git a/cmd/eval/main.go b/cmd/eval/main.go
index 152824c..cd593a3 100644
--- a/cmd/eval/main.go
+++ b/cmd/eval/main.go
@@ -1,18 +1,16 @@
package main
import (
- "context"
-
"dim13.org/j1"
"dim13.org/j1/console"
)
func main() {
- vm := j1.New()
+ con := console.New()
+ defer con.Stop()
+ vm := j1.New(con)
if err := vm.LoadFile("testdata/j1e.bin"); err != nil {
panic(err)
}
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
- vm.Run(ctx, cancel, console.New(ctx))
+ vm.Run()
}
diff --git a/cmd/j1e/main.go b/cmd/j1e/main.go
index 8f31aeb..934d416 100644
--- a/cmd/j1e/main.go
+++ b/cmd/j1e/main.go
@@ -3,16 +3,14 @@ package main
//go:generate file2go -in ../../testdata/j1e.bin
import (
- "context"
-
"dim13.org/j1"
"dim13.org/j1/console"
)
func main() {
- vm := j1.New()
+ con := console.New()
+ defer con.Stop()
+ vm := j1.New(con)
vm.LoadBytes(J1eBin)
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
- vm.Run(ctx, cancel, console.New(ctx))
+ vm.Run()
}