|
29 | 29 | #define urgentTasks 2 |
30 | 30 | #define LS_DEFSTEPS 10 |
31 | 31 |
|
32 | | -#define VERSION "1.14.07.12" |
| 32 | +#define VERSION "1.16.06.17" |
33 | 33 |
|
34 | 34 | struct Task |
35 | 35 | { |
@@ -374,86 +374,83 @@ static int addTask(lua_State *L) |
374 | 374 |
|
375 | 375 | msg = "_LS={} " |
376 | 376 | "function _LS.tableToString(t) " |
377 | | - " if type(t) ~= 'table' then return nil, 'Expected table parameter' end " |
378 | | - " local rL = {cL = 1} " |
379 | | - " rL[rL.cL] = {} " |
380 | | - " local tabIndex = {} " |
381 | | - " local latestTab = 0 " |
382 | | - " do " |
383 | | - " rL[rL.cL]._f,rL[rL.cL]._s,rL[rL.cL]._var = pairs(t) " |
384 | | - " rL[rL.cL].str = 't0={}' " |
385 | | - " rL[rL.cL].t = t " |
386 | | - " rL[rL.cL].tabIndex = 0 " |
387 | | - " tabIndex[t] = rL[rL.cL].tabIndex " |
388 | | - " while true do " |
389 | | - " local key " |
390 | | - " local k,v = rL[rL.cL]._f(rL[rL.cL]._s,rL[rL.cL]._var) " |
391 | | - " rL[rL.cL]._var = k " |
392 | | - " if not k and rL.cL == 1 then " |
393 | | - " break " |
394 | | - " elseif not k then " |
395 | | - " rL[rL.cL-1].str = rL[rL.cL-1].str..'\\n'..rL[rL.cL].str " |
396 | | - " rL.cL = rL.cL - 1 " |
397 | | - " if rL[rL.cL].vNotDone then " |
398 | | - " key = 't'..rL[rL.cL].tabIndex..'[t'..tostring(rL[rL.cL+1].tabIndex)..']' " |
399 | | - " rL[rL.cL].str = rL[rL.cL].str..'\\n'..key..'=' " |
400 | | - " v = rL[rL.cL].vNotDone " |
401 | | - " end " |
402 | | - " rL[rL.cL+1] = nil " |
403 | | - " else " |
404 | | - " if type(k) == 'number' then " |
405 | | - " key = 't'..rL[rL.cL].tabIndex..'['..tostring(k)..']' " |
406 | | - " rL[rL.cL].str = rL[rL.cL].str..'\\n'..key..'=' " |
407 | | - " elseif type(k) == 'string' then " |
408 | | - " key = 't'..rL[rL.cL].tabIndex..'.'..tostring(k) " |
409 | | - " rL[rL.cL].str = rL[rL.cL].str..'\\n'..key..'=' " |
410 | | - " else " |
411 | | - " if tabIndex[k] then " |
412 | | - " key = 't'..rL[rL.cL].tabIndex..'[t'..tabIndex[k]..']' " |
413 | | - " rL[rL.cL].str = rL[rL.cL].str..'\\n'..key..'=' " |
414 | | - " else " |
415 | | - " latestTab = latestTab + 1 " |
416 | | - " rL[rL.cL].str = rL[rL.cL].str..'\\nt'..tostring(latestTab)..'={}' " |
417 | | - " rL[rL.cL].vNotDone = v " |
418 | | - " rL.cL = rL.cL + 1 " |
419 | | - " rL[rL.cL] = {} " |
420 | | - " rL[rL.cL]._f,rL[rL.cL]._s,rL[rL.cL]._var = pairs(k) " |
421 | | - " rL[rL.cL].tabIndex = latestTab " |
422 | | - " rL[rL.cL].t = k " |
423 | | - " rL[rL.cL].str = '' " |
424 | | - " tabIndex[k] = rL[rL.cL].tabIndex " |
425 | | - " end " |
426 | | - " end " |
427 | | - " end " |
428 | | - " if key then " |
429 | | - " rL[rL.cL].vNotDone = nil " |
430 | | - " if type(v) == 'table' then " |
431 | | - " if tabIndex[v] then " |
432 | | - " rL[rL.cL].str = rL[rL.cL].str..'t'..tabIndex[v] " |
433 | | - " else " |
434 | | - " latestTab = latestTab + 1 " |
435 | | - " rL[rL.cL].str = rL[rL.cL].str..'{}' " |
436 | | - " rL[rL.cL].str = rL[rL.cL].str..'\\nt'..tostring(latestTab)..'='..key " |
437 | | - " rL.cL = rL.cL + 1 " |
438 | | - " rL[rL.cL] = {} " |
439 | | - " rL[rL.cL]._f,rL[rL.cL]._s,rL[rL.cL]._var = pairs(v) " |
440 | | - " rL[rL.cL].tabIndex = latestTab " |
441 | | - " rL[rL.cL].t = v " |
442 | | - " rL[rL.cL].str = '' " |
443 | | - " tabIndex[v] = rL[rL.cL].tabIndex " |
444 | | - " end " |
445 | | - " elseif type(v) == 'number' then " |
446 | | - " rL[rL.cL].str = rL[rL.cL].str..tostring(v) " |
447 | | - " elseif type(v) == 'boolean' then " |
448 | | - " rL[rL.cL].str = rL[rL.cL].str..tostring(v) " |
449 | | - " else " |
450 | | - " rL[rL.cL].str = rL[rL.cL].str..string.format('%q',tostring(v)) " |
451 | | - " end " |
452 | | - " end " |
453 | | - " end " |
454 | | - " end " |
455 | | - " return rL[rL.cL].str " |
456 | | - "end " |
| 377 | + " if type(t) ~= 'table' then return nil, 'Expected table parameter' end " |
| 378 | + " local rL = {cL = 1} " |
| 379 | + " rL[rL.cL] = {} " |
| 380 | + " local tabIndex = {} " |
| 381 | + " local latestTab = 0 " |
| 382 | + " local result = {} " |
| 383 | + " do " |
| 384 | + " rL[rL.cL]._f,rL[rL.cL]._s,rL[rL.cL]._var = pairs(t) " |
| 385 | + " result[#result + 1] = 't0={}' " |
| 386 | + " rL[rL.cL].t = t " |
| 387 | + " rL[rL.cL].tabIndex = 0 " |
| 388 | + " tabIndex[t] = rL[rL.cL].tabIndex " |
| 389 | + " while true do " |
| 390 | + " local key " |
| 391 | + " local k,v = rL[rL.cL]._f(rL[rL.cL]._s,rL[rL.cL]._var) " |
| 392 | + " rL[rL.cL]._var = k " |
| 393 | + " if not k and rL.cL == 1 then " |
| 394 | + " break " |
| 395 | + " elseif not k then " |
| 396 | + " rL.cL = rL.cL - 1 " |
| 397 | + " if rL[rL.cL].vNotDone then " |
| 398 | + " key = 't'..rL[rL.cL].tabIndex..'[t'..tostring(rL[rL.cL+1].tabIndex)..']' " |
| 399 | + " result[#result + 1] = '\\n'..key..'=' " |
| 400 | + " v = rL[rL.cL].vNotDone " |
| 401 | + " end " |
| 402 | + " rL[rL.cL+1] = nil " |
| 403 | + " else " |
| 404 | + " if type(k) == 'number' then " |
| 405 | + " key = 't'..rL[rL.cL].tabIndex..'['..tostring(k)..']' " |
| 406 | + " result[#result + 1] = '\\n'..key..'=' " |
| 407 | + " elseif type(k) == 'string' then " |
| 408 | + " key = 't'..rL[rL.cL].tabIndex..'.'..tostring(k) " |
| 409 | + " result[#result + 1] = '\\n'..key..'=' " |
| 410 | + " else " |
| 411 | + " if tabIndex[k] then " |
| 412 | + " key = 't'..rL[rL.cL].tabIndex..'[t'..tabIndex[k]..']' " |
| 413 | + " result[#result + 1] = '\\n'..key..'=' " |
| 414 | + " else " |
| 415 | + " latestTab = latestTab + 1 " |
| 416 | + " result[#result + 1] = '\\nt'..tostring(latestTab)..'={}' " |
| 417 | + " rL[rL.cL].vNotDone = v " |
| 418 | + " rL.cL = rL.cL + 1 " |
| 419 | + " rL[rL.cL] = {} " |
| 420 | + " rL[rL.cL]._f,rL[rL.cL]._s,rL[rL.cL]._var = pairs(k) " |
| 421 | + " rL[rL.cL].tabIndex = latestTab " |
| 422 | + " rL[rL.cL].t = k " |
| 423 | + " tabIndex[k] = rL[rL.cL].tabIndex " |
| 424 | + " end " |
| 425 | + " end " |
| 426 | + " end " |
| 427 | + " if key then " |
| 428 | + " rL[rL.cL].vNotDone = nil " |
| 429 | + " if type(v) == 'table' then " |
| 430 | + " if tabIndex[v] then " |
| 431 | + " result[#result + 1] = 't'..tabIndex[v] " |
| 432 | + " else " |
| 433 | + " latestTab = latestTab + 1 " |
| 434 | + " result[#result + 1] = '{}\nt'..tostring(latestTab)..'='..key " |
| 435 | + " rL.cL = rL.cL + 1 " |
| 436 | + " rL[rL.cL] = {} " |
| 437 | + " rL[rL.cL]._f,rL[rL.cL]._s,rL[rL.cL]._var = pairs(v) " |
| 438 | + " rL[rL.cL].tabIndex = latestTab " |
| 439 | + " rL[rL.cL].t = v " |
| 440 | + " tabIndex[v] = rL[rL.cL].tabIndex " |
| 441 | + " end " |
| 442 | + " elseif type(v) == 'number' then " |
| 443 | + " result[#result + 1] = tostring(v) " |
| 444 | + " elseif type(v) == 'boolean' then " |
| 445 | + " result[#result + 1] = tostring(v) " |
| 446 | + " else " |
| 447 | + " result[#result + 1] = string.format('%q',tostring(v)) " |
| 448 | + " end " |
| 449 | + " end " |
| 450 | + " end " |
| 451 | + " end " |
| 452 | + " return table.concat(result) " |
| 453 | + "end " |
457 | 454 | "do" |
458 | 455 | " local pack = package " |
459 | 456 | " local req = require " |
|
0 commit comments