Mercurial Hosting > luan
comparison src/luan/modules/Boot.luan @ 1426:94a6a209d4e2
fix
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 24 Nov 2019 16:38:06 -0700 |
parents | 9ab267b9427c |
children | 56fb5cd8228d |
comparison
equal
deleted
inserted
replaced
1425:b6030fa18839 | 1426:94a6a209d4e2 |
---|---|
50 this.read_blocks = io.read_blocks | 50 this.read_blocks = io.read_blocks |
51 this.exists = io.exists | 51 this.exists = io.exists |
52 this.checksum = io.checksum | 52 this.checksum = io.checksum |
53 this.charset = io.charset | 53 this.charset = io.charset |
54 this.set_charset = io.set_charset | 54 this.set_charset = io.set_charset |
55 | 55 this.to_uri_string = io.to_uri_string |
56 function this.to_uri_string() | |
57 return this.uri_string or io.to_uri_string() | |
58 end | |
59 | |
60 return this | 56 return this |
61 end | 57 end |
62 Boot.new_LuanIn = new_LuanIn | 58 Boot.new_LuanIn = new_LuanIn |
63 | 59 |
64 local function new_writer(writer) | 60 local function new_writer(writer) |
250 end | 246 end |
251 local src = u.read_text() | 247 local src = u.read_text() |
252 return load(src,file) | 248 return load(src,file) |
253 elseif type(file) == "table" and file.read_text ~= nil then | 249 elseif type(file) == "table" and file.read_text ~= nil then |
254 local src = file.read_text() | 250 local src = file.read_text() |
255 return load(src,file.to_uri_string()) | 251 local src_file = file.uri_string or file.to_uri_string() |
252 return load(src,src_file) | |
256 else | 253 else |
257 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)) |
258 end | 255 end |
259 end | 256 end |
260 | 257 |