Mercurial Hosting > luan
comparison src/luan/tools/CmdLine.java @ 88:6ca02b188dba
add LuanBit to clean up code;
add repr();
git-svn-id: https://luan-java.googlecode.com/svn/trunk@89 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Wed, 27 Feb 2013 23:50:32 +0000 |
parents | 6db8f286fa6c |
children | 754e6030c029 |
comparison
equal
deleted
inserted
replaced
87:eaf37cfa30c2 | 88:6ca02b188dba |
---|---|
41 if( ++i == args.length ) | 41 if( ++i == args.length ) |
42 error("'-e' needs argument"); | 42 error("'-e' needs argument"); |
43 String cmd = args[i]; | 43 String cmd = args[i]; |
44 try { | 44 try { |
45 LuanFunction fn = BasicLib.load(luan,cmd,"(command line)",env); | 45 LuanFunction fn = BasicLib.load(luan,cmd,"(command line)",env); |
46 luan.call(fn,null,null); | 46 luan.JAVA.call(fn,null); |
47 } catch(LuanException e) { | 47 } catch(LuanException e) { |
48 System.err.println("command line error: "+e.getMessage()); | 48 System.err.println("command line error: "+e.getMessage()); |
49 System.exit(-1); | 49 System.exit(-1); |
50 } | 50 } |
51 } else if( arg.equals("-") ) { | 51 } else if( arg.equals("-") ) { |
73 argsTable.put( j, args[j] ); | 73 argsTable.put( j, args[j] ); |
74 } | 74 } |
75 env.put("arg",argsTable); | 75 env.put("arg",argsTable); |
76 try { | 76 try { |
77 LuanFunction fn = BasicLib.load_file(luan,file,env); | 77 LuanFunction fn = BasicLib.load_file(luan,file,env); |
78 luan.call(fn,null,null,varArgs); | 78 luan.JAVA.call(fn,null,varArgs); |
79 } catch(LuanException e) { | 79 } catch(LuanException e) { |
80 // System.err.println("error: "+e.getMessage()); | 80 // System.err.println("error: "+e.getMessage()); |
81 e.printStackTrace(); | 81 e.printStackTrace(); |
82 System.exit(-1); | 82 System.exit(-1); |
83 } | 83 } |