Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local top
- function mklabel(name, func)
- if not top then top = func end
- local isTop = top == func
- local suc, res = pcall(func)
- if not suc then
- if not res:find("__BREAKFROM") then error(res, -1) end
- local target = res:gsub("[^\:]+:[^\:]+: __BREAKFROM", "")
- if name ~= target then
- if isTop then
- error("Tried to break from label '" .. target .. "' which does not exist.", 2)
- end
- error("__BREAKFROM" .. target)
- end
- end
- if isTop then top = nil end
- end
- function breakfrom(name)
- error("__BREAKFROM" .. name)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement