diff core/src/luan/modules/BasicLuan.java @ 694:b620b8e1010f

remove Luan.load() allow_expression param and add Luan.eval()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 20 Apr 2016 20:56:08 -0600
parents ca169567ce07
children b21d82ee5756
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java	Tue Apr 19 15:54:11 2016 -0600
+++ b/core/src/luan/modules/BasicLuan.java	Wed Apr 20 20:56:08 2016 -0600
@@ -15,7 +15,6 @@
 import luan.LuanException;
 import luan.LuanMethod;
 import luan.LuanMeta;
-import luan.impl.LuanCompiler;
 
 
 public final class BasicLuan {
@@ -24,12 +23,12 @@
 		return Luan.type(obj);
 	}
 
-	public static LuanFunction load(LuanState luan,String text,String sourceName,LuanTable env,Boolean allowExpr)
+	public static LuanFunction load(String text,String sourceName,LuanTable env)
 		throws LuanException
 	{
-		if( allowExpr==null )
-			allowExpr = false;
-		return LuanCompiler.compile(sourceName,text,env,allowExpr);
+		Utils.checkNotNull(text);
+		Utils.checkNotNull(sourceName,1);
+		return Luan.load(text,sourceName,env);
 	}
 
 	public static LuanFunction load_file(LuanState luan,String fileName) throws LuanException {
@@ -41,7 +40,7 @@
 		String src = PackageLuan.read(luan,fileName);
 		if( src == null )
 			throw new LuanException("file '"+fileName+"' not found" );
-		return load(luan,src,fileName,null,false);
+		return load(src,fileName,null);
 	}
 
 	public static LuanFunction pairs(final LuanState luan,final LuanTable t) throws LuanException {