// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer FoldClosure_firstFree=0 integer FoldClosure_maxIndex=0 integer array LinkedList_nextFree integer LinkedList_firstFree=0 integer LinkedList_maxIndex=0 integer array LinkedList_typeId endglobals function initGlobals takes nothing returns nothing endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function new_LinkedList takes nothing returns integer local integer this if LinkedList_firstFree == 0 then if LinkedList_maxIndex < 32768 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this = LinkedList_maxIndex set LinkedList_typeId[this] = 3 else call error("Out of memory: Could not create LinkedList.") set this = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this] = 3 endif return this endfunction function init_test takes nothing returns nothing local integer x = new_LinkedList() if FoldClosure_firstFree == 0 then if FoldClosure_maxIndex < 32768 then set FoldClosure_maxIndex = FoldClosure_maxIndex + 1 else call error("Out of memory: Could not create FoldClosure_foldl_test.") endif else set FoldClosure_firstFree = FoldClosure_firstFree - 1 endif if LinkedList_typeId[x] == 0 then if x == 0 then call error("Nullpointer exception when calling LinkedList.foldl") else call error("Called LinkedList.foldl on invalid object.") endif endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction