Commit Graph

10 Commits

Author SHA1 Message Date
James Roseborough
e154a158a9 Add ipow, to compute power for integers. 2007-09-22 05:25:02 +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
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
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
32dcbaca3a Make modulo arithmetic conform to lua rules for negative values. 2007-08-01 04:57:12 +00:00
James Roseborough
93fc4699a9 Type coercion for luajava package, make luajava an "addon" 2007-06-24 15:04:19 +00:00
James Roseborough
19bd995ba6 Enhance binary compare operators, especially equals, to more closely match what standard lua does. 2007-06-14 04:58:09 +00:00
James Roseborough
de763e0a1e Support for iterator-style for loops, and "pairs" builting function 2007-06-10 22:53:09 +00:00
James Roseborough
e1e6625aa1 Add binary compares, some unary ops, fix binary arithmetic, add plain for loop. 2007-06-10 19:49:47 +00:00
James Roseborough
70dfc20f57 Initial draft of interpreter. Lua compiled "chunks" can be unmarshalled. Approximately half of bytecodes implemented in some form or another. 2007-06-08 05:11:37 +00:00