Skip to content

Commit

Permalink
fix the load() wrapper ignoring multiline strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocawesome101 committed Dec 10, 2021
1 parent 5e2ca1d commit 4ab303d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions base/load.lua
Expand Up @@ -23,7 +23,8 @@ if (not k.cmdline.no_force_yields) then
return s
end
local function process(chunk)
local process
process = function(chunk)
local i = 1
local ret = ""
local nq = 0
Expand All @@ -35,7 +36,12 @@ if (not k.cmdline.no_force_yields) then
i = nextquote + 1
nq = nq + 1
if nq % 2 == 1 then
ch = process_section(ch)
-- the quote check might skip multiline strings, so use recursion and
-- avoid that. i tried checking for multiline definitions at the same
-- time as quotes, but that was far too slow to be practical thanks to
-- the fact that OpenComputers wraps the Lua pattern matching
-- functions.
ch = process(ch)
end
ret = ret .. ch
else
Expand Down

0 comments on commit 4ab303d

Please sign in to comment.