Vultraz

Untitled

Apr 22nd, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1. local function getSubtag(p, f, n, i)
  2.     p = toCfg(p)
  3.     n = n or 1
  4.     for i = i or 1, #p do
  5.         if match(p[i], f) then
  6.             n = n-1
  7.             if n <= 0 then
  8.                 return p[i], i
  9.             end
  10.         end
  11.     end
  12. end
  13.  
  14. function lp8.children(p, f, i)
  15.     return function(s)
  16.         local c, i = getSubtag(p, f, 1, s.i)
  17.         s.i = i
  18.         return (c or et)[2], i
  19.     end, {i = i or 1}
  20. end
Advertisement
Add Comment
Please, Sign In to add comment