<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/main/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.go')
-rw-r--r--main/main.go20
1 files changed, 8 insertions, 12 deletions
diff --git a/main/main.go b/main/main.go
index 8e8c369..b7ef568 100644
--- a/main/main.go
+++ b/main/main.go
@@ -7,10 +7,8 @@ import (
"main/json"
)
-type Program []Command
-
type ProgramState struct {
- path, value, xreg, yreg, zreg walk.ValueList
+ value, xreg, yreg, zreg []walk.Value
in walk.StredReader
out walk.StredWriter
program []Command
@@ -55,23 +53,21 @@ func main() {
if err != nil {
break
}
- state.value = walkItem.Value
- state.path = walkItem.Path
+ state.value = []walk.Value{walkItem.Value}
state.pc = 0
for state.pc < len(state.program) {
state.program[state.pc].exec(&state)
}
if !quiet {
- err := state.out.Write(walk.WalkItem {
- Path: state.path,
- Value: state.value,
- })
- if err != nil {
- panic("Error while outputting")
+ for _, value := range state.value {
+ err := state.out.Write(value)
+ if err != nil {
+ panic("Error while outputting")
+ }
}
}
}
state.in.AssertDone()
state.out.AssertDone()
-} \ No newline at end of file
+}