app is now live, can communicate with driver

[?]
Nov 27, 2022, 10:27 PM
TBWAE64A6IIDDXKB6LXDI6WQYAAUYP2QRH3KLM3PUILMVL2BFTTAC

Dependencies

  • [2] LRDM35CE app running again
  • [3] RXNR3U5E Merge text.love
  • [4] KKMFQDR4 editing source code from within the app
  • [5] 36Z442IV back to commit 8123959e52f without code editing
  • [6] AVTNUQYR basic test-enabled framework
  • [7] DJSIRUMD a more radical attempt at ignoring nil y's
  • [8] 3QNOKBFM beginnings of a test harness
  • [9] AGJXIDOF hardcode some assumptions about how this app uses love
  • [10] JOPVPUSA editing source code from within the app
  • [11] 2CTN2IEF Merge lines.love
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • edit in main.lua at line 76
    [3.5257][3.5257:5572]()
    Text.redraw_all(Editor_state)
    Editor_state.selection1 = {} -- no support for shift drag while we're resizing
    Editor_state.right = App.screen.width-Margin_right
    Editor_state.width = Editor_state.right-Editor_state.left
    Text.tweak_screen_top_and_cursor(Editor_state, Editor_state.left, Editor_state.right)
  • edit in main.lua at line 95
    [3.6105]
    [2.225]
    live.update(dt)
  • edit in live.lua at line 38
    [2.2015]
    [2.2015]
    Live.Previous_read = 0
  • replacement in live.lua at line 152
    [2.5164][2.5164:5243]()
    local f = io.open(love.filesystem.getUserDirectory()..'/_love_akkartik_app')
    [2.5164]
    [2.5243]
    local f = io.open(love.filesystem.getUserDirectory()..'/_love_akkartik_driver_app')
  • replacement in live.lua at line 161
    [2.5522][2.5522:5610]()
    local clear = io.open(love.filesystem.getUserDirectory()..'/_love_akkartik_app', 'w')
    [2.5522]
    [2.5610]
    local clear = io.open(love.filesystem.getUserDirectory()..'/_love_akkartik_driver_app', 'w')
  • replacement in live.lua at line 167
    [2.5671][2.5671:5758]()
    local f = io.open(love.filesystem.getUserDirectory()..'/_love_akkartik_driver', 'w')
    [2.5671]
    [2.5758]
    local f = io.open(love.filesystem.getUserDirectory()..'/_love_akkartik_app_driver', 'w')
  • edit in live.lua at line 176
    [2.5897]
    [2.5897]
    function live.send_run_time_error(msg)
    local f = io.open(love.filesystem.getUserDirectory()..'/_love_akkartik_app_driver_run_time_error', 'w')
    if f == nil then return end
    f:write(msg)
    f:close()
    print('=>'..app.color(0, --[[red]]1))
    print(msg)
    print(app.reset_terminal())
    end
  • edit in live.lua at line 276
    [2.8904][2.8904:9011]()
    function live.run()
    love.load(love.arg.parseGameArguments(arg), arg)
    love.timer.step()
    local dt = 0
  • edit in live.lua at line 277
    [2.9012][2.9012:9163]()
    return function()
    local status, result = xpcall(live.try_run, live.handle_error)
    return result
    end
    end
    -- one iteration of the event loop
  • edit in live.lua at line 278
    [2.9221][2.9221:9908]()
    -- from https://love2d.org/wiki/love.run
    function live.try_run()
    if love.event then
    love.event.pump()
    for name, a,b,c,d,e,f in love.event.poll() do
    if name == 'quit' then
    if not love.quit() then
    return a or 0
    end
    end
    love.handlers[name](a,b,c,d,e,f)
    end
    end
    -- update
    dt = love.timer.step()
    love.update(dt)
    -- draw before update to give it a chance to mutate state
    love.graphics.origin()
    love.graphics.clear(love.graphics.getBackgroundColor())
    love.draw()
    love.graphics.present()
    love.timer.sleep(0.001)
    -- returning nil continues the loop
    end
    -- return nil to continue the event loop, non-nil to quit
  • replacement in live.lua at line 291
    [2.10619][2.10619:10654]()
    live.send('ERROR '..stack_trace)
    [2.10619]
    [2.10654]
    live.send_run_time_error(stack_trace)
  • replacement in app.lua at line 3
    [3.1772][3.1772:1868]()
    -- Most apps can just use the default, but we need to override it to
    -- install a test harness.
    [3.1772]
    [3.1868]
    -- Most apps can just use the default (https://love2d.org/wiki/love.run), but
    -- we need to override it to install a test harness.
  • replacement in app.lua at line 26
    [3.187][3.187:207]()
    return function()
    [3.187]
    [3.207]
    -- one iteration of the event loop
    -- return nil to continue the event loop, non-nil to quit
    App.run_frame = function()
  • edit in app.lua at line 50
    [3.391]
    [3.915]
    -- returning nil continues the loop
    end
    -- protect against runtime errors
    return function()
    local status, result = xpcall(App.run_frame, live.handle_error)
    return result