Mercurial Hosting > luan
comparison src/luan/lib/BasicLib.java @ 125:0cd559a16758
add sockets
git-svn-id: https://luan-java.googlecode.com/svn/trunk@126 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 06 Jun 2014 05:59:11 +0000 |
parents | f537ff5e511d |
children | f0a4abe58593 |
comparison
equal
deleted
inserted
replaced
124:f537ff5e511d | 125:0cd559a16758 |
---|---|
90 return LuanCompiler.compileModule(luan,new LuanSource(sourceName,text)); | 90 return LuanCompiler.compileModule(luan,new LuanSource(sourceName,text)); |
91 } | 91 } |
92 | 92 |
93 public static LuanFunction load_file(LuanState luan,String fileName) throws LuanException { | 93 public static LuanFunction load_file(LuanState luan,String fileName) throws LuanException { |
94 try { | 94 try { |
95 String src = fileName==null ? Utils.readAll(new InputStreamReader(System.in)) : Utils.read(new File(fileName)); | 95 String src = fileName==null ? Utils.readAll(new InputStreamReader(System.in)) : new IoLib.LuanFile(fileName).read_text(); |
96 return load(luan,src,fileName,false); | 96 return load(luan,src,fileName,false); |
97 } catch(IOException e) { | 97 } catch(IOException e) { |
98 throw luan.JAVA.exception(e); | 98 throw luan.JAVA.exception(e); |
99 } | 99 } |
100 } | 100 } |