changeset 473:bab5607a0eed

move do_file implementation to luan
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 10 May 2015 00:25:48 -0600
parents f4aca5a5346a
children 00646edc9d92
files core/src/luan/modules/BasicLuan.java core/src/luan/modules/Luan.luan
diffstat 2 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java	Sun May 10 00:22:11 2015 -0600
+++ b/core/src/luan/modules/BasicLuan.java	Sun May 10 00:25:48 2015 -0600
@@ -43,11 +43,6 @@
 		return load(luan,src,fileName,null,false);
 	}
 
-	public static Object do_file(LuanState luan,String fileName) throws LuanException {
-		LuanFunction fn = load_file(luan,fileName,null);
-		return luan.call(fn);
-	}
-
 	public static LuanFunction pairs(final LuanState luan,final LuanTable t) throws LuanException {
 		Utils.checkNotNull(luan,t);
 		return t.pairs(luan);
--- a/core/src/luan/modules/Luan.luan	Sun May 10 00:22:11 2015 -0600
+++ b/core/src/luan/modules/Luan.luan	Sun May 10 00:25:48 2015 -0600
@@ -8,7 +8,6 @@
 assert_number = BasicLuan.assert_number
 assert_string = BasicLuan.assert_string
 assert_table = BasicLuan.assert_table
-do_file = BasicLuan.do_file
 error = BasicLuan.error
 get_metatable = BasicLuan.get_metatable
 ipairs = BasicLuan.ipairs
@@ -27,9 +26,12 @@
 type = BasicLuan.type
 values = BasicLuan.values
 
+function do_file(uri)
+	return load_file(uri)()
+end
+
 VERSION = do_file "classpath:luan/version.luan"
 
-
 local error = error
 
 function assert(v,message)