Commit Graph

85 Commits

Author SHA1 Message Date
Shu Lei
341a5588b0 first step to bring debugging code to j2me 2007-10-12 01:36:28 +00:00
James Roseborough
a5745d5da0 Turn off debug support by default. 2007-10-10 04:34:46 +00:00
Shu Lei
8eab291c9b make the debugging support code compile under JDK 1.3 2007-10-10 00:26:23 +00:00
James Roseborough
435368ccd9 Fix metatable processing on luaGetTable 2007-10-09 04:09:00 +00:00
Shu Lei
1f817c774c bug fix 2007-10-09 00:25:44 +00:00
James Roseborough
251e055594 Fix StrLib test case by fixing pcall to restore currenct call after exceptions 2007-10-06 18:48:37 +00:00
James Roseborough
0353660299 Convert to new JavaFunction api 2007-10-05 22:00:31 +00:00
James Roseborough
ec9cff9050 Misc fixes to java api 2007-10-05 18:38:42 +00:00
James Roseborough
e4882578f2 Add "Java API" like "C API" for use with JavaFunctions. 2007-10-04 23:51:39 +00:00
James Roseborough
9be13fcc1d Convert return value of luaLength to be int 2007-10-04 23:17:09 +00:00
Shu Lei
a67783899f removed Type.java and updated the depended files to use the new type constants 2007-10-04 21:04:38 +00:00
James Roseborough
eba4f34505 Fix reported type of LBoolean 2007-10-04 20:44:52 +00:00
James Roseborough
72bfd0a376 remove dependence on Type class. 2007-10-04 20:44:03 +00:00
James Roseborough
8ae4299764 centralize type id defs 2007-10-04 20:10:50 +00:00
James Roseborough
9dee79cb80 Make LInteger constructor private and use LInteger.valueOf() everywhere, caching common values. 2007-10-04 17:37:15 +00:00
Shu Lei
885397a74c added back the files that were accidentally deleted 2007-10-03 23:33:45 +00:00
Shu Lei
35d02b287e added debugging support and integrated with Eclipse debugger 2007-10-03 17:39:38 +00:00
Shu Lei
421eface40 added debugging support and integrated with Eclipse debugger 2007-10-03 17:39:37 +00:00
James Roseborough
673d0e4117 Expose final fields of LString 2007-09-26 00:44:53 +00:00
Ian Farmer
ec11c472c8 Various changes to bring pm.lua test closer to passing:
* New and complete character class support
 * string.gsub implemented
 * rawset implemented
 * lua_call added (based on lua_pcall)
 * lua_pop added
 * newCall removed; luaGetTable and luaSetTable in LFunction updated to
   use lua_call instead.
 * StandardTest changed to avoid an ArrayIndexOutOfBoundsException

Unfortunately I discovered a problem where execute() will loop around too
many times and call exec() with a call frame that has already completed.
This might be due to the lack of the "tailcalls" field in our CallInfo class
that the C version maintains?
2007-09-24 04:35:53 +00:00
James Roseborough
9f6d7543cd Remove compiler dependence on mark()/reset() 2007-09-22 16:57:25 +00:00
James Roseborough
e07382c90d Fix autoload 2007-09-22 07:14:23 +00:00
James Roseborough
e154a158a9 Add ipow, to compute power for integers. 2007-09-22 05:25:02 +00:00
James Roseborough
90cc227e34 Add compiler by default. 2007-09-22 00:25:36 +00:00
James Roseborough
2db26b0844 Many built-ins: ipairs, table.insert, require, pcall 2007-09-21 00:34:14 +00:00
James Roseborough
d45bd96536 Add "require" support. 2007-09-20 18:17:10 +00:00
Ian Farmer
fc8c790b0d Fixes for string.rep, string.byte, string.lower, and string.upper. Also
factor out negative index handling to separate function, posrelat (to
match C Lua). When converting numbers to strings, see if the double value
can be represented exactly as a long, and if so format the string as
an integer. With these changes the standard test case "strings.lua" runs
to line 104 (over half way through!), where it uses string.format.
2007-09-19 04:44:31 +00:00
James Roseborough
32e1fedba5 Improve error handling, introduce lua stack trace processing. 2007-09-18 22:55:22 +00:00
Ian Farmer
bd6dd58a2d String related improvements:
(1) Fix string.char and string.byte (argument indexing was off by one)
(2) Implement string.find
(3) Change calls to charAt, which does array bounds checking, in the
    pattern matcher with calls to luaByte, which does not.
(4) Replace use of recursion with while/continue in pattern matcher.
2007-09-18 05:17:09 +00:00
Ian Farmer
534e69fcfb Add pattern matcher implementation ported from C version of Lua. Still
work to do:
(1) Replace use of recursion with while/continue
(2) Remove as many array bounds checks as possible
2007-09-18 04:18:39 +00:00
James Roseborough
952a2f9f16 Add skeleton for string library calls. 2007-09-18 01:00:36 +00:00
James Roseborough
5efda81b17 Add loadstring and other standard library commands (untested) 2007-09-15 00:51:30 +00:00
Ian Farmer
6d0e9bb566 Add some helper methods:
(1) getKeys() in LTable is now public. It provides a convenient interface
    to access the table's elements from Java instead of Lua.
(2) LString.toInputStream produces an instance of InputStream from which
    the string's bytes can be read.
2007-09-12 05:22:30 +00:00
Ian Farmer
aeafca11b6 Change LString to use an array of bytes instead of wrapping Java's String.
This brings our implementation more in line with regular C Lua.
2007-09-10 06:27:54 +00:00
Ian Farmer
aa44eedf4b Allow metatable operations on values of all types, and use the metatable
on strings as the string package, so that string functions can be called
with self (:) syntax. Autoload test case now inexplicably fails more,
but it was already broken.
2007-09-08 20:54:40 +00:00
Ian Farmer
0f81c4deaf Fix typo and add TODO comment. 2007-09-03 06:00:37 +00:00
Ian Farmer
49bcc0d2f8 Fix a bug where "base" was not set correctly for metatable operations. 2007-09-03 05:53:55 +00:00
Ian Farmer
b8571b93f9 New implementation for Lua tables. Does not use Vector or Hashtable, instead
uses plain Java arrays directly to keep heap allocation to a minimum.
Includes some unit tests that seem to indicate the basic operations are
correct. However, the following things are not implemented:

* Shrinking the capacity when elements are removed
* Optimal storage of each element in array vs. hash when entries are
  added out of order. A junit test case is there for this.
2007-09-03 00:38:38 +00:00
James Roseborough
79d5642bfd Fix breakpoint handling 2007-08-11 05:29:56 +00:00
James Roseborough
add892968d Add DebugStackState to be used as a debugging VM in and IDE. 2007-08-11 04:53:35 +00:00
Shu Lei
a80351e1ef added the skeleton code for luaJ debugging support 2007-08-10 06:31:21 +00:00
James Roseborough
5fb097d107 Fix varargs handling 2007-08-02 03:00:46 +00:00
James Roseborough
80677e9a16 Let Nil be converted to int, but other values cannot. 2007-08-01 06:16:28 +00:00
James Roseborough
01c5595fd6 Let luaAsInt() return sensible values for non-numeric data. 2007-08-01 06:11:43 +00:00
James Roseborough
32dcbaca3a Make modulo arithmetic conform to lua rules for negative values. 2007-08-01 04:57:12 +00:00
Ian Farmer
737c5e2855 Various changes:
(1) New lua compatibility bindings, including select() and math functions
(2) fix some VM bugs
(3) fix some table bugs, and attempt to restore metatable functionality.
2007-08-01 04:15:27 +00:00
James Roseborough
68b3e68169 Remove unused variables. 2007-07-31 05:47:35 +00:00
James Roseborough
7cd3195bcd Add guard to prevent null values from being put on stack 2007-07-30 04:53:58 +00:00
James Roseborough
fbeded0388 Make printCode public, remove unused code from Lua.java 2007-07-29 17:39:15 +00:00
Christopher Colby
b9fdb731fe optimization for tables that include sequential integral indices starting with 0.
commented out: a more sophisticated (but space-consuming) optimization
that accounts for arbitrary starting index, stride, and direction (increasing/decreasing).

commented out some table metatable stuff that was wrong.  metatables
need to be implemented properly.
2007-07-24 06:22:07 +00:00