comparison 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
comparison
equal deleted inserted replaced
692:7bd97d642f37 693:ca169567ce07
30 if( allowExpr==null ) 30 if( allowExpr==null )
31 allowExpr = false; 31 allowExpr = false;
32 return LuanCompiler.compile(sourceName,text,env,allowExpr); 32 return LuanCompiler.compile(sourceName,text,env,allowExpr);
33 } 33 }
34 34
35 public static LuanFunction load_file(LuanState luan,String fileName,Boolean addExtension) throws LuanException { 35 public static LuanFunction load_file(LuanState luan,String fileName) throws LuanException {
36 if( fileName == null ) 36 if( fileName == null ) {
37 fileName = "stdin:"; 37 fileName = "stdin:";
38 String src = PackageLuan.read(luan,fileName,addExtension); 38 } else if( fileName.indexOf(':') == -1 ) {
39 fileName = "file:" + fileName;
40 }
41 String src = PackageLuan.read(luan,fileName);
39 if( src == null ) 42 if( src == null )
40 throw new LuanException("file '"+fileName+"' not found" ); 43 throw new LuanException("file '"+fileName+"' not found" );
41 return load(luan,src,fileName,null,false); 44 return load(luan,src,fileName,null,false);
42 } 45 }
43 46