Last active
May 17, 2021 23:33
-
-
Save CapsAdmin/89093e968353a44b4ef8f3a860a58014 to your computer and use it in GitHub Desktop.
repat until continue goto problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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