|
428 | 428 | blockContents:find!("^ *for%s+"..PATTERN_IDENT.."%s*[,=]") or |
429 | 429 | blockContents:find!("^ *for%s+"..PATTERN_IDENT.."%s+in"..PATTERN_IDENT_END) |
430 | 430 | then |
431 | | - table.insert(out, blockContents) -- @Robustness: Surround value in parenthesis. |
| 431 | + table.insert(out, blockContents) -- @Robustness: Surround value in parenthesis, when possible. |
432 | 432 | table.insert(out, " do ") |
433 | 433 |
|
434 | 434 | !!(TRIM_POS_AFTER_BLOCK) |
|
684 | 684 | if not ok then error(errObj) end |
685 | 685 |
|
686 | 686 | local templateResult = (table.concat(ctx.out) |
687 | | - :gsub("[ \t]+\n", "\n" ) -- :Beautify |
688 | | - :gsub("\n\n\n+", "\n\n") -- :Beautify @UX Not sure if this line is actually good. |
| 687 | + :gsub("[ \t]+\n", "\n" ) -- :Beautify spaces at the end of lines. |
| 688 | + :gsub("\n\n\n+", "\n\n") -- :Beautify empty lines. @Robustness: Not sure this is actually good. Might mess up <pre> tag contents. |
689 | 689 | ) |
690 | 690 |
|
691 | 691 | return templateResult |
|
774 | 774 |
|
775 | 775 |
|
776 | 776 | function _G.getLineNumber(s, pos) |
777 | | - local lineCount = 1 |
778 | | - for posCurrent in s:gmatch"()\n" do -- @Speed |
779 | | - if posCurrent < pos then |
780 | | - lineCount = lineCount+1 |
781 | | - else |
782 | | - break |
783 | | - end |
784 | | - end |
785 | | - return lineCount |
| 777 | + return 1 + countSubStrings(s, 1, pos-1, "\n", true) |
786 | 778 | end |
787 | 779 |
|
788 | 780 |
|
|
1906 | 1898 | local modTimeThumb = lfs.attributes(DIR_OUTPUT.."/"..pathThumbOutputRel, "modification") |
1907 | 1899 |
|
1908 | 1900 | if modTimeImage and modTimeImage == modTimeThumb and not ignoreModificationTimes then |
1909 | | - -- @Note: This will bypass any file processor for JPG files. Not sure if OK. 2018-06-30 |
| 1901 | + -- Note: This will bypass any file processor for JPG files. Not sure if OK. 2018-06-30 @Consistency |
1910 | 1902 | preserveExistingOutputFile("raw", pathThumbRel, "/"..pathThumbRel, pathImageRel) |
1911 | 1903 |
|
1912 | 1904 | else |
@@ -2427,7 +2419,7 @@ function _G.cleanupPath(someKindOfPath) |
2427 | 2419 |
|
2428 | 2420 | repeat |
2429 | 2421 | local count |
2430 | | - path, count = path:gsub("/[^/]+/%.%./", "/", 1) -- Not completely fool proof! @Robustness |
| 2422 | + path, count = path:gsub("/[^/]+/%.%./", "/", 1) -- Not completely fool proof! We may need to properly parse the path, I think. @Robustness |
2431 | 2423 | until count == 0 |
2432 | 2424 |
|
2433 | 2425 | return path |
|
2561 | 2553 | socket.sleep(duration) |
2562 | 2554 | else |
2563 | 2555 | local endTime = getTimeBetter() + duration |
2564 | | - repeat until getTimeBetter() >= endTime -- @Incomplete: Do something to waste time? |
| 2556 | + repeat until getTimeBetter() >= endTime -- Should we do some better operation to waste time? |
2565 | 2557 | end |
2566 | 2558 | end |
2567 | 2559 | end |
|
0 commit comments