From 080a24e894f125d4f1741cfdcba7cb722304d209 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Fri, 29 Mar 2024 09:49:26 +0000 Subject: Completely remove the path space The new design uses deeply nested values in the value space instead. --- main/main.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'main/main.go') 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 +} -- cgit v1.2.3