go-vise

Constrained Size Output Virtual Machine
Info | Log | Files | Refs | README | LICENSE

commit dce2aaec18f6b0b52b7ee5bf6603891907473823
parent 4a177a837097568386a8521a6a3ae805e5873cd7
Author: lash <dev@holbrook.no>
Date:   Sat, 29 Apr 2023 08:48:59 +0100

Rehabilitate examples

Diffstat:
Mexamples/profile/entry_email.vis | 6+++---
Mexamples/profile/entry_name.vis | 6+++---
Mexamples/profile/root.vis | 4++--
Mexamples/session/input.vis | 2+-
Mexamples/validate/end.vis | 2+-
Mtestdata/foo.vis | 8++++----
Mtestdata/testdata.go | 12++++++------
7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/examples/profile/entry_email.vis b/examples/profile/entry_email.vis @@ -1,5 +1,5 @@ MAP myemail -MOUT 0 "abort" +MOUT abort 0 HALT -INCMP 0 _ -INCMP * entry_email_save +INCMP _ 0 +INCMP entry_email_save * diff --git a/examples/profile/entry_name.vis b/examples/profile/entry_name.vis @@ -1,5 +1,5 @@ MAP myname -MOUT 0 "abort" +MOUT abort 0 HALT -INCMP 0 _ -INCMP * entry_name_save +INCMP _ 0 +INCMP entry_name_save * diff --git a/examples/profile/root.vis b/examples/profile/root.vis @@ -1,5 +1,5 @@ LOAD myname 64 LOAD myemail 64 CATCH identified 8 1 -DOWN entry_name 0 "name" -DOWN entry_email 1 "email" +DOWN entry_name 0 name +DOWN entry_email 1 email diff --git a/examples/session/input.vis b/examples/session/input.vis @@ -1,4 +1,4 @@ MAP do_save HALT RELOAD do_save -INCMP * . +INCMP . * diff --git a/examples/validate/end.vis b/examples/validate/end.vis @@ -1,3 +1,3 @@ HALT LOAD again 0 -INCMP * _ +INCMP _ * diff --git a/testdata/foo.vis b/testdata/foo.vis @@ -1,7 +1,7 @@ -MOUT 1 tofoo -MOUT 2 gobar +MOUT tofoo 1 +MOUT gobar 2 LOAD inky 20 HALT -INCMP 1 _ -INCMP 2 baz +INCMP _ 1 +INCMP baz 2 CATCH _catch 1 1 diff --git a/testdata/testdata.go b/testdata/testdata.go @@ -51,9 +51,9 @@ func out(sym string, b []byte, tpl string, data map[string]string) error { func root() error { b := []byte{} - b = vm.NewLine(b, vm.MOUT, []string{"1", "do the foo"}, nil, nil) - b = vm.NewLine(b, vm.MOUT, []string{"2", "go to the bar"}, nil, nil) - b = vm.NewLine(b, vm.MOUT, []string{"3", "language template"}, nil, nil) + b = vm.NewLine(b, vm.MOUT, []string{"do the foo", "1"}, nil, nil) + b = vm.NewLine(b, vm.MOUT, []string{"go to the bar", "2"}, nil, nil) + b = vm.NewLine(b, vm.MOUT, []string{"language template", "3"}, nil, nil) b = vm.NewLine(b, vm.HALT, nil, nil, nil) b = vm.NewLine(b, vm.INCMP, []string{"foo", "1"}, nil, nil) b = vm.NewLine(b, vm.INCMP, []string{"bar", "2"}, nil, nil) @@ -66,9 +66,9 @@ func root() error { func foo() error { b := []byte{} - b = vm.NewLine(b, vm.MOUT, []string{"0", "to foo"}, nil, nil) - b = vm.NewLine(b, vm.MOUT, []string{"1", "go bar"}, nil, nil) - b = vm.NewLine(b, vm.MOUT, []string{"2", "see long"}, nil, nil) + b = vm.NewLine(b, vm.MOUT, []string{"to foo", "0"}, nil, nil) + b = vm.NewLine(b, vm.MOUT, []string{"go bar", "1"}, nil, nil) + b = vm.NewLine(b, vm.MOUT, []string{"see long", "2"}, nil, nil) b = vm.NewLine(b, vm.LOAD, []string{"inky"}, []byte{20}, nil) b = vm.NewLine(b, vm.HALT, nil, nil, nil) b = vm.NewLine(b, vm.INCMP, []string{"_", "0"}, nil, nil)