This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sewbacca's profile picture

[1.8.9][SSP]String pattern %f[x] errors

Started by Sewbacca, 11 September 2016 - 07:30 PM
Sewbacca #1
Posted 11 September 2016 - 09:30 PM
VERSION: 1.8.9
DESCRIPTION:
It errors when I try to gsub a 'foo;foo' with the pattern '%f[;]'
EXPECTED RESULT:
'foo-foo'
REPRODUCTION STEPS:
string.gsub('foo;foo', '%f[;]')

INFO:
I'm not sure if it is really a bug, because the string patterns are really broken in luaj.
KingofGamesYami #2
Posted 11 September 2016 - 10:42 PM
This would be a LuaJ bug. I'm not even sure if it counts as a bug, as frontier patterns (%f) aren't really official.

http://lua-users.org/lists/lua-l/2006-12/msg00536.html

Aaron Brown, author of Beginning Lua Programming said:
The fact that %f is undocumented means that it may –
without notice – change or disappear altogether in a
subsequent release of Lua. It also means that there's no
explicit guarantee of its behavior
, and it may act
unexpectedly when used in unusual situations
Sewbacca #3
Posted 11 September 2016 - 11:04 PM
This would be a LuaJ bug. I'm not even sure if it counts as a bug, as frontier patterns (%f) aren't really official.

http://lua-users.org...2/msg00536.html

Aaron Brown, author of Beginning Lua Programming said:
The fact that %f is undocumented means that it may –
without notice – change or disappear altogether in a
subsequent release of Lua. It also means that there's no
explicit guarantee of its behavior
, and it may act
unexpectedly when used in unusual situations
Okay.
I hope, that we will update to Lua 5.2 soon.
SquidDev #4
Posted 12 September 2016 - 07:19 AM
I've reported this bug a while back on the GitHub repo with an accompanying fix, hopefully it will be merged soon. Alternatively you can use CCTweaks' Cobalt VM which fixes uses this fix.
Edited on 12 September 2016 - 01:13 PM
Sewbacca #5
Posted 12 September 2016 - 11:11 AM
I've reported this bug a while back GitHub repo with an accompanying fix, hopefully it will be merged soon. Alternatively you can use CCTweaks' Cobalt VM which fixes uses this fix.

Thanks, but I just played with string patterns ^^. I will use it if I need it.