nosuchtim / keykit

KeyKit - an algorithmic MIDI scripting language and GUI system
Other
98 stars 7 forks source link

Coalese multiple arrays together into array of structures #3449

Closed pbarada closed 9 months ago

pbarada commented 9 months ago

In keykit, there are two areas where multiple arrays are used to track data in lockstep - instruction segments (Iseg, Lastin, Future) and nested source context (Fin, Infile, Lineno, Autopop). Replace all those arrays with two arrays of structures, InstSegment that holds Iseg, Lastin, Future, and SourceContext that holds Fin, Infile Lineo and Autopop. When execerror is called, need to "unwind" SourceContext back to what was in effect when execstack was called - add popscontextuntil(level) that pops source context until the saved level matchs the current level - allowing following calls to pushfin to succeed.