Skip to content

Instantly share code, notes, and snippets.

@CapsAdmin
Last active May 17, 2021 23:33
Show Gist options
  • Save CapsAdmin/89093e968353a44b4ef8f3a860a58014 to your computer and use it in GitHub Desktop.
Save CapsAdmin/89093e968353a44b4ef8f3a860a58014 to your computer and use it in GitHub Desktop.
repat until continue goto problem
-- INPUT:
--[[
local exit = false
repeat
if exit then break end
if true then
continue
end
local foo
print("you should not see this")
until (function() print("this should run once") exit = true end)()
]]
-- OUTPUT:
local exit = false
while true do -- repeat
if exit then break end
if true then
goto continue
end
do
local foo
print("you should not see this")
--[[until without continue]]
if (function() print("this should run once") exit = true end)() then break end
goto end_of_loop
end
--[[until with continue]]
::continue::
if (function() print("this should run once") exit = true end)() then break end
::end_of_loop::
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment