Mercurial Hosting > luan
comparison src/luan/modules/Boot.luan @ 1434:56fb5cd8228d
cache compiled code in temp files
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 29 Dec 2019 15:25:07 -0700 |
parents | 94a6a209d4e2 |
children | 580ee513a4b7 |
comparison
equal
deleted
inserted
replaced
1433:5f038be65271 | 1434:56fb5cd8228d |
---|---|
243 local u = uri(file) | 243 local u = uri(file) |
244 if u==nil or not u.exists() then | 244 if u==nil or not u.exists() then |
245 return nil | 245 return nil |
246 end | 246 end |
247 local src = u.read_text() | 247 local src = u.read_text() |
248 return load(src,file) | 248 return load(src,file,true) |
249 elseif type(file) == "table" and file.read_text ~= nil then | 249 elseif type(file) == "table" and file.read_text ~= nil then |
250 local src = file.read_text() | 250 local src = file.read_text() |
251 local src_file = file.uri_string or file.to_uri_string() | 251 local src_file = file.uri_string or file.to_uri_string() |
252 return load(src,src_file) | 252 return load(src,src_file,true) |
253 else | 253 else |
254 error("bad argument, expected string or uri table but got "..type(file)) | 254 error("bad argument, expected string or uri table but got "..type(file)) |
255 end | 255 end |
256 end | 256 end |
257 | 257 |