Mercurial Hosting > luan
diff core/src/luan/modules/BasicLuan.java @ 693:ca169567ce07
module URIs must now include ".luan"
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 19 Apr 2016 15:54:11 -0600 |
parents | fc08c3b42010 |
children | b620b8e1010f |
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java Mon Apr 18 20:40:21 2016 -0600 +++ b/core/src/luan/modules/BasicLuan.java Tue Apr 19 15:54:11 2016 -0600 @@ -32,10 +32,13 @@ return LuanCompiler.compile(sourceName,text,env,allowExpr); } - public static LuanFunction load_file(LuanState luan,String fileName,Boolean addExtension) throws LuanException { - if( fileName == null ) + public static LuanFunction load_file(LuanState luan,String fileName) throws LuanException { + if( fileName == null ) { fileName = "stdin:"; - String src = PackageLuan.read(luan,fileName,addExtension); + } else if( fileName.indexOf(':') == -1 ) { + fileName = "file:" + fileName; + } + String src = PackageLuan.read(luan,fileName); if( src == null ) throw new LuanException("file '"+fileName+"' not found" ); return load(luan,src,fileName,null,false);