get("#137") -- split text = getSnippet("#2000013") lines = split(text, "\n") byline = {} n = 0 for _, l in ipairs(lines) do _, _, x, ann = l:find("^line ([^:]+): +(.*)") if x == nil then print("Warning: ignoring line. "..l) else a, b = unpack(split(x, "\-")) if b == nil then b = a end for y = tonumber(a), tonumber(b) do byline[y] = ann end n = math.max(n, tonumber(b)) end end for i=1, n do print(byline[i] or '') end
e.g. for #2000013
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show
Snippet ID: | #512 |
Snippet name: | Line annotations expander |
Eternal ID of this version: | #512/1 |
Text MD5: | 19f2e846cf9c59325dbcb6a0633cfed8 |
Author: | stefan |
Category: | |
Type: | Lua code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-03-11 18:10:44 |
Source code size: | 485 bytes / 24 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 1068 / 179 |
Referenced in: | [show references] |