Mercurial Hosting > luan
comparison src/luan/modules/Luan.luan @ 1280:781ec0a92bb5
add Boot.luan
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Thu, 20 Dec 2018 13:38:16 -0700 |
| parents | 198d6af7330a |
| children | 11d3640e739d |
comparison
equal
deleted
inserted
replaced
| 1279:323743a7f317 | 1280:781ec0a92bb5 |
|---|---|
| 1 java() | 1 java() |
| 2 local BasicLuan = require "java:luan.modules.BasicLuan" | 2 local BasicLuan = require "java:luan.modules.BasicLuan" |
| 3 local Boot = require "luan:Boot.luan" | |
| 3 | 4 |
| 4 local Luan = {} | 5 local Luan = {} |
| 5 | 6 |
| 7 Luan.error = Boot.error | |
| 6 Luan.get_metatable = BasicLuan.get_metatable | 8 Luan.get_metatable = BasicLuan.get_metatable |
| 7 Luan.hash_code = BasicLuan.hash_code | 9 Luan.hash_code = BasicLuan.hash_code |
| 8 Luan.ipairs = BasicLuan.ipairs | 10 Luan.ipairs = BasicLuan.ipairs |
| 9 Luan.load = BasicLuan.load | 11 Luan.load = BasicLuan.load |
| 10 Luan.load_file = BasicLuan.load_file | 12 Luan.load_file = BasicLuan.load_file |
| 27 return Luan.load_file(uri)() | 29 return Luan.load_file(uri)() |
| 28 end | 30 end |
| 29 | 31 |
| 30 Luan.VERSION = Luan.do_file "classpath:luan/version.luan" | 32 Luan.VERSION = Luan.do_file "classpath:luan/version.luan" |
| 31 | 33 |
| 32 function Luan.error(message) | |
| 33 Luan.new_error(message).throw() | |
| 34 end | |
| 35 | |
| 36 function Luan.eval(s,source_name) | 34 function Luan.eval(s,source_name) |
| 37 return Luan.load( "return "..s, source_name or "eval" )() | 35 return Luan.load( "return "..s, source_name or "eval" )() |
| 38 end | 36 end |
| 39 | 37 |
| 40 return Luan | 38 return Luan |
