comparison src/luan/tools/CmdLine.java @ 46:a443637829c1

remove LuaNumber git-svn-id: https://luan-java.googlecode.com/svn/trunk@47 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Thu, 27 Dec 2012 01:48:36 +0000
parents 57054fa43189
children 64ecb7a3aad7
comparison
equal deleted inserted replaced
45:b1b14d09fc98 46:a443637829c1
8 import luan.lib.TableLib; 8 import luan.lib.TableLib;
9 import luan.Lua; 9 import luan.Lua;
10 import luan.LuaState; 10 import luan.LuaState;
11 import luan.LuaFunction; 11 import luan.LuaFunction;
12 import luan.LuaTable; 12 import luan.LuaTable;
13 import luan.LuaNumber;
14 import luan.LuaException; 13 import luan.LuaException;
15 import luan.interp.LuaCompiler; 14 import luan.interp.LuaCompiler;
16 15
17 16
18 public class CmdLine { 17 public class CmdLine {
70 String file = args[i++]; 69 String file = args[i++];
71 Object[] varArgs = new Object[args.length-1]; 70 Object[] varArgs = new Object[args.length-1];
72 System.arraycopy(args,1,varArgs,0,varArgs.length); 71 System.arraycopy(args,1,varArgs,0,varArgs.length);
73 LuaTable argsTable = new LuaTable(); 72 LuaTable argsTable = new LuaTable();
74 for( int j=0; j<args.length; j++ ) { 73 for( int j=0; j<args.length; j++ ) {
75 argsTable.put( LuaNumber.of(j), args[j] ); 74 argsTable.put( j, args[j] );
76 } 75 }
77 lua.global().put("arg",argsTable); 76 lua.global().put("arg",argsTable);
78 try { 77 try {
79 LuaFunction fn = BasicLib.load_file(lua,file); 78 LuaFunction fn = BasicLib.load_file(lua,file);
80 lua.call(fn,null,null,varArgs); 79 lua.call(fn,null,null,varArgs);