don't use coroutine to yield template code (fixes issue in lapis)

This commit is contained in:
leaf corcoran
2013-10-28 09:35:39 -07:00
parent 1344dee1e1
commit 92f0f7d78a
2 changed files with 17 additions and 6 deletions

View File

@@ -204,9 +204,17 @@ do
if name == nil then
name = "etlua"
end
local code_fn = coroutine.wrap(function()
return coroutine.yield(code)
end)
local code_fn
do
local code_ref = code
code_fn = function()
do
local ret = code_ref
code_ref = nil
return ret
end
end
end
local fn, err = load(code_fn, name)
if not (fn) then
do

View File

@@ -1,4 +1,4 @@
VERSION = "1.0.1"
VERSION = "1.0.2"
import insert, concat from table
@@ -163,8 +163,11 @@ class Parser
"#{err_msg} [#{source_line_no}]: #{source_line}"
load: (code, name="etlua") =>
code_fn = coroutine.wrap ->
coroutine.yield code
code_fn = do
code_ref = code
->
with ret = code_ref
code_ref = nil
fn, err = load code_fn, name