dan200 / ComputerCraft

Programmable Computers for Minecraft
Other
980 stars 198 forks source link

LuaJ String bugs #91

Closed SquidDev closed 8 years ago

SquidDev commented 8 years ago

This aren't bugs with ComputerCraft but with LuaJ. I understand that this isn't within the scope of this bug tracker, just thought it might be useful.

I've got a set of fixes and test cases if you want to fix/test this. This doesn't correctly handle the %g modifier.


I've also added a fix for string.find returning the wrong index on a previous match (which I guess is what the string.find and string.match overrides in bios.lua are for).

dan200 commented 8 years ago

Fixed the string.find bug in my LuaJ fork and removed the bios.lua hacks. May merge in the other fixes later.

dan200 commented 8 years ago

Fixed the infinite loop, whitespace not matching \v (this is actually caused by a typo in the original code, which i corrected), and the out of bounds exception. I will not be implementing the string.format fixes due to code complexity and relative unimportance.

SquidDev commented 8 years ago

Awesome! Thanks.