Merge luaML.love

This commit is contained in:
Kartik K. Agaram 2023-12-15 15:33:45 -08:00
commit 24060d6ae7
1 changed files with 4 additions and 4 deletions

View File

@ -106,7 +106,7 @@ function live.receive_from_driver()
local result = f:read('*a')
f:close()
if result == '' then return nil end -- empty file == no message
print('<='..color(--[[bold]]1, --[[blue]]4))
print('<='..color_escape(--[[bold]]1, --[[blue]]4))
print(result)
print(reset_terminal())
os.remove(love.filesystem.getAppdataDirectory()..'/_love_akkartik_driver2_driver')
@ -118,7 +118,7 @@ function live.send_to_driver(msg)
if f == nil then return end
f:write(msg)
f:close()
print('=>'..color(0, --[[green]]2))
print('=>'..color_escape(0, --[[green]]2))
print(msg)
print(reset_terminal())
end
@ -128,7 +128,7 @@ function live.send_run_time_error_to_driver(msg)
if f == nil then return end
f:write(msg)
f:close()
print('=>'..color(0, --[[red]]1))
print('=>'..color_escape(0, --[[red]]1))
print(msg)
print(reset_terminal())
end
@ -136,7 +136,7 @@ end
-- args:
-- format: 0 for normal, 1 for bold
-- color: 0-15
function color(format, color)
function color_escape(format, color)
return ('\027[%d;%dm'):format(format, 30+color)
end