Commit Graph

8 Commits

Author SHA1 Message Date
James Roseborough
3906bb9968 Add tests for some uncovered functions. 2008-06-04 15:33:21 +00:00
Ian Farmer
60323962f7 Fix string.len (includes new tests.) 2008-06-02 05:53:32 +00:00
James Roseborough
78b231353f quote results. 2007-12-13 01:04:08 +00:00
James Roseborough
b8b65767b5 More test cases for string.sub() 2007-12-13 01:03:02 +00:00
Ian Farmer
ad5e776dc9 Add a string.gmatch call to strlib.lua test case and fix the bug it exposed. 2007-11-19 23:06:26 +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
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
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