Mercurial Hosting > luan
comparison core/src/luan/modules/BasicLuan.java @ 462:2e79b47d02a2
remove all command line options;
add add_extension boolean arg to scheme fns;
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 06 May 2015 16:54:20 -0600 |
parents | 8b2db645b9b2 |
children | f3a24435d04d |
comparison
equal
deleted
inserted
replaced
461:e12841f7edef | 462:2e79b47d02a2 |
---|---|
32 if( allowExpr==null ) | 32 if( allowExpr==null ) |
33 allowExpr = false; | 33 allowExpr = false; |
34 return LuanCompiler.compile(luan,new LuanSource(sourceName,text),env,allowExpr); | 34 return LuanCompiler.compile(luan,new LuanSource(sourceName,text),env,allowExpr); |
35 } | 35 } |
36 | 36 |
37 public static LuanFunction load_file(LuanState luan,String fileName,LuanTable env) throws LuanException { | 37 public static LuanFunction load_file(LuanState luan,String fileName,Boolean addExtension) throws LuanException { |
38 if( fileName == null ) | 38 if( fileName == null ) |
39 fileName = "stdin:"; | 39 fileName = "stdin:"; |
40 String src = PackageLuan.read(luan,fileName); | 40 String src = PackageLuan.read(luan,fileName,addExtension); |
41 if( src == null ) | 41 if( src == null ) |
42 throw luan.exception( "file '"+fileName+"' not found" ); | 42 throw luan.exception( "file '"+fileName+"' not found" ); |
43 return load(luan,src,fileName,env,false); | 43 return load(luan,src,fileName,null,false); |
44 } | 44 } |
45 | 45 |
46 public static Object do_file(LuanState luan,String fileName) throws LuanException { | 46 public static Object do_file(LuanState luan,String fileName) throws LuanException { |
47 LuanFunction fn = load_file(luan,fileName,null); | 47 LuanFunction fn = load_file(luan,fileName,null); |
48 return luan.call(fn); | 48 return luan.call(fn); |