Commit Graph

79 Commits

Author SHA1 Message Date
James Roseborough
434530b60f Table unit tests and implementation of table.remove(), table.sort() 2007-10-31 23:24:51 +00:00
James Roseborough
facb8d1d07 Unit test for table package functions 2007-10-31 19:03:18 +00:00
Shu Lei
e97b842b45 1. added stepping debug support
2. added debugger error handling
2007-10-24 20:21:16 +00:00
James Roseborough
b86e06ab1c Coroutine implementation based on Java Threads. 2007-10-23 21:24:49 +00:00
James Roseborough
504020beda Fix coroutine.wrap() error propogation. 2007-10-23 00:49:52 +00:00
James Roseborough
932960c846 Add tests for pcall, add error() builtin, fix assert(), error levels. 2007-10-23 00:34:04 +00:00
James Roseborough
8248cca2bf implement corouting.wrap(), fix bugs in coroutine.status(), fix StackState.insert() 2007-10-22 21:05:04 +00:00
James Roseborough
78eaaf0fa0 Initial draft of coroutines library. 2007-10-20 00:51:15 +00:00
James Roseborough
8e2ff119f9 Add LValue.toJavaX and VM.pushboxedx() functions for all java basic type conversions 2007-10-18 17:47:01 +00:00
Shu Lei
38dafdb190 1. some refacotring
2. fixed a few files so that they will compile for j2me
2007-10-12 20:39:26 +00:00
Shu Lei
3138fdee65 refactoring - create new packages: lua.debug.event, lua.debug.request and lua.debug.response 2007-10-12 01:42:42 +00:00
Shu Lei
341a5588b0 first step to bring debugging code to j2me 2007-10-12 01:36:28 +00:00
James Roseborough
710f13dafc Convert to java 1.3 source style and enable all classes to be built using java class version 1.1 2007-10-10 03:53:22 +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
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
ec9cff9050 Misc fixes to java api 2007-10-05 18:38:42 +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
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
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
Ian Farmer
f801e648bb New math.cos and math.sqrt functions from Lua standard library, with new
math library test case. Also, character encoding of LuaCompat was changed
from something that Eclipse was not handling well to UTF-8.
2007-09-23 03:54:06 +00:00
Ian Farmer
5536159916 Now that compiler is integrated, change LuaJTest to load source files when
pre-compiled script is missing.
2007-09-23 03:51:26 +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
be87758fe5 add compiler to vm as add-on 2007-09-21 16:50:29 +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
Ian Farmer
a55504639e Add unit test for LString.toInputStream (meant to commit this a while ago) 2007-09-18 05:29:29 +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
Ian Farmer
108fabc58f Add missing return statement in autoload test case. Still doesn't work. 2007-09-18 04:16:46 +00:00
James Roseborough
952a2f9f16 Add skeleton for string library calls. 2007-09-18 01:00:36 +00:00
Ian Farmer
31e2d95076 Fix broken LTable test case. 2007-09-10 06:41:25 +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
35131f9f66 Fix "factorial" function in test case that was not actually factorial function. 2007-09-05 03:02:57 +00:00
Ian Farmer
75fb975410 Fix a few VM issues which were causing subtle failures in the test cases.
Includes a new VM method, newCall, which must be called before pushing
a call onto the stack to make sure that base is set correctly.
A couple of weird issues remain with autoload.lua.
2007-09-04 01:52:33 +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
James Roseborough
b8376fe0ef Fix tail call argument handling. 2007-08-03 05:42:50 +00:00
James Roseborough
5fb097d107 Fix varargs handling 2007-08-02 03:00:46 +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
8bf4c82a12 Rework the main API"s that implement the calling convention. Provide utility methods to get arguments that were supplied, and provide return values. Add a VM interface to clarify the relationship between the VM, things that call the VM, and things that are called by the VM. Make the code more closely aligned with the C++ version. 2007-07-24 05:06:10 +00:00
Ian Farmer
ee5007e718 Add implicit LString to number coercions. 2007-07-22 06:20:14 +00:00
Ian Farmer
daf71ee672 New LuaCompat add-on provides some standard lua functions that allow the
test cases to make more progress: assert, collectgarbage, loadfile,
tonumber, rawget, and setfenv. Also added zip file of standard tests to
Eclipse classpath, for convenience.
2007-07-22 05:47:14 +00:00
Ian Farmer
e1d6ddf99c New autoload and math test cases. Currently autoload does not work because
the GETGLOBAL instruction does not handle the case where a metatable method
is invoked.
2007-07-21 04:44:22 +00:00
Ian Farmer
b4ac032fd7 Fix the NOT instruction. Includes test case. 2007-07-21 04:08:28 +00:00