~akkartik/luaML.love

a6a6d8567e056607945290c2c06a8d4f2571dfa2 — Kartik K. Agaram 3 months ago f41c7d7 + 207fb4f
Merge template-live-editor
1 files changed, 19 insertions(+), 9 deletions(-)

M app.lua
M app.lua => app.lua +19 -9
@@ 374,16 374,26 @@ end
-- fake files
function App.open_for_writing(filename)
  App.filesystem[filename] = ''
  return {
    write = function(self, ...)
              local args = {...}
              for i,s in ipairs(args) do
  if Current_app == nil or Current_app == 'run' then
    return {
      write = function(self, ...)
                local args = {...}
                for i,s in ipairs(args) do
                  App.filesystem[filename] = App.filesystem[filename]..s
                end
              end,
      close = function(self)
              end,
    }
  elseif Current_app == 'source' then
    return {
      write = function(self, s)
                App.filesystem[filename] = App.filesystem[filename]..s
              end
            end,
    close = function(self)
            end,
  }
              end,
      close = function(self)
              end,
    }
  end
end

function App.open_for_reading(filename)