// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals string array test_s integer test_s_max=0 integer array FoldClosure_nextFree integer FoldClosure_firstFree=0 integer FoldClosure_maxIndex=0 integer array FoldClosure_typeId integer array LinkedList_nextFree integer LinkedList_firstFree=0 integer LinkedList_maxIndex=0 integer array LinkedList_typeId integer array LinkedList_x integer wurst_stack_depth=0 string array wurst_stack endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function error takes string msg, string w__wurst_stackPos returns nothing local integer stacktraceIndex local integer stacktraceLimit set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set w__wurst_stackPos = "" set stacktraceIndex = wurst_stack_depth set stacktraceLimit = 0 loop set stacktraceIndex = stacktraceIndex - 1 set stacktraceLimit = stacktraceLimit + 1 exitwhen stacktraceLimit > 20 or stacktraceIndex < 0 set w__wurst_stackPos = w__wurst_stackPos + "\n " + wurst_stack[stacktraceIndex] endloop call BJDebugMsg(msg + "\n" + w__wurst_stackPos) set wurst_stack_depth = wurst_stack_depth - 1 endfunction function run_wrapper takes integer this, integer t, integer q returns integer local string b = test_s[q] + I2S(t) + "," set test_s_max = test_s_max + 1 set test_s[test_s_max] = b return test_s_max endfunction function dispatch_LinkedList_test_LinkedList_foldl takes integer this, integer startValue, integer predicate, string w__wurst_stackPos returns integer local integer t set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 if LinkedList_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling LinkedList.foldl", "when calling error in normalFoldlInfer, line 14") else call error("Called LinkedList.foldl on invalid object.", "when calling error in normalFoldlInfer, line 14") endif endif set wurst_stack[wurst_stack_depth] = "when calling foldl in normalFoldlInfer, line 14" set wurst_stack_depth = wurst_stack_depth + 1 set t = LinkedList_x[this] set wurst_stack[wurst_stack_depth] = "when calling run in normalFoldlInfer, line 15" set wurst_stack_depth = wurst_stack_depth + 1 if FoldClosure_typeId[predicate] == 0 then if predicate == 0 then call error("Nullpointer exception when calling FoldClosure.run", "when calling error in normalFoldlInfer, line 20") else call error("Called FoldClosure.run on invalid object.", "when calling error in normalFoldlInfer, line 20") endif endif set startValue = run_wrapper(predicate, t, startValue) set wurst_stack_depth = wurst_stack_depth - 1 - 1 - 1 return startValue endfunction function LinkedList_toString takes integer this, string w__wurst_stackPos returns string local integer temp local integer this_1 set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set test_s_max = test_s_max + 1 set test_s[test_s_max] = "[" set temp = test_s_max set wurst_stack[wurst_stack_depth] = "when calling alloc_FoldClosure_foldl_LinkedList_test in normalFoldlInfer, line 17" set wurst_stack_depth = wurst_stack_depth + 1 if FoldClosure_firstFree == 0 then if FoldClosure_maxIndex < 32768 then set FoldClosure_maxIndex = FoldClosure_maxIndex + 1 set this_1 = FoldClosure_maxIndex set FoldClosure_typeId[this_1] = 2 else call error("Out of memory: Could not create FoldClosure_foldl_LinkedList_test.", "when calling error in normalFoldlInfer, line 17") set this_1 = 0 endif else set FoldClosure_firstFree = FoldClosure_firstFree - 1 set this_1 = FoldClosure_nextFree[FoldClosure_firstFree] set FoldClosure_typeId[this_1] = 2 endif set wurst_stack_depth = wurst_stack_depth - 1 set w__wurst_stackPos = test_s[dispatch_LinkedList_test_LinkedList_foldl(this, temp, this_1, "when calling foldl in normalFoldlInfer, line 17")] set wurst_stack_depth = wurst_stack_depth - 1 return w__wurst_stackPos + "]" endfunction function new_LinkedList takes string w__wurst_stackPos returns integer local integer this set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set wurst_stack[wurst_stack_depth] = "when calling alloc_LinkedList in normalFoldlInfer, line 12" set wurst_stack_depth = wurst_stack_depth + 1 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.", "when calling error in normalFoldlInfer, line 12") set this = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this] = 3 endif set wurst_stack_depth = wurst_stack_depth - 1 - 1 return this endfunction function init_test takes string w__wurst_stackPos returns nothing local integer x set wurst_stack[wurst_stack_depth] = w__wurst_stackPos set wurst_stack_depth = wurst_stack_depth + 1 set test_s_max = -1 set x = new_LinkedList("when calling new_LinkedList in normalFoldlInfer, line 22") set LinkedList_x[x] = 5 set wurst_stack[wurst_stack_depth] = "when calling toString in normalFoldlInfer, line 24" set wurst_stack_depth = wurst_stack_depth + 1 if LinkedList_typeId[x] == 0 then if x == 0 then call error("Nullpointer exception when calling LinkedList.toString", "when calling error in normalFoldlInfer, line 16") else call error("Called LinkedList.toString on invalid object.", "when calling error in normalFoldlInfer, line 16") endif endif set w__wurst_stackPos = LinkedList_toString(x, "when calling toString in normalFoldlInfer, line 16") set wurst_stack_depth = wurst_stack_depth - 1 if w__wurst_stackPos == "[5,]" then call testSuccess() endif set wurst_stack_depth = wurst_stack_depth - 1 endfunction function main takes nothing returns nothing call initGlobals() call init_test("when calling init_test in normalFoldlInfer, line 1") endfunction function config takes nothing returns nothing endfunction