// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1366 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 endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function run_wrapper takes integer this, integer t, integer q returns integer local integer i = t local integer i_1 = q local string q_1 = test_s[i_1] local string b = q_1 + I2S(i) + "," 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 returns integer local integer test_LinkedList_foldl_result local integer this_1 local integer startValue_1 local integer predicate_1 local integer this_2 local integer t local integer q local integer test_FoldClosure_run_result if LinkedList_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling LinkedList.foldl") else call error("Called LinkedList.foldl on invalid object.") endif endif set this_1 = this set startValue_1 = startValue set predicate_1 = predicate set this_2 = predicate_1 set t = LinkedList_x[this_1] set q = startValue_1 if FoldClosure_typeId[this_2] == 0 then if this_2 == 0 then call error("Nullpointer exception when calling FoldClosure.run") else call error("Called FoldClosure.run on invalid object.") endif endif set test_FoldClosure_run_result = run_wrapper(this_2, t, q) set test_LinkedList_foldl_result = test_FoldClosure_run_result return test_LinkedList_foldl_result endfunction function LinkedList_toString takes integer this returns string local integer temp = this local string b = "[" local string fold local integer clVar local integer temp_1 local integer this_1 local integer i set test_s_max = test_s_max + 1 set test_s[test_s_max] = b set temp_1 = test_s_max 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.") 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 clVar = this_1 set i = dispatch_LinkedList_test_LinkedList_foldl(temp, temp_1, clVar) set fold = test_s[i] return fold + "]" endfunction function new_LinkedList takes nothing returns integer local integer this local integer this_1 if LinkedList_firstFree == 0 then if LinkedList_maxIndex < 32768 then set LinkedList_maxIndex = LinkedList_maxIndex + 1 set this_1 = LinkedList_maxIndex set LinkedList_typeId[this_1] = 3 else call error("Out of memory: Could not create LinkedList.") set this_1 = 0 endif else set LinkedList_firstFree = LinkedList_firstFree - 1 set this_1 = LinkedList_nextFree[LinkedList_firstFree] set LinkedList_typeId[this_1] = 3 endif set this = this_1 return this endfunction function init_test takes nothing returns nothing local integer x local integer this local string test_LinkedList_toString_result set test_s_max = -1 set x = new_LinkedList() set LinkedList_x[x] = 5 set this = x if LinkedList_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling LinkedList.toString") else call error("Called LinkedList.toString on invalid object.") endif endif set test_LinkedList_toString_result = LinkedList_toString(this) if test_LinkedList_toString_result == "[5,]" then call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_test() endfunction function config takes nothing returns nothing endfunction