lua-users home
lua-l archive

LuaJIT-2.0.0-beta9 and Lua 5.1.4: different behavior

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello!
I've found a little difference between the way how LuaJIT and LUA parse string. In the string 'test\)' the last bracket treated as a mistake by LJ, but LUA ignores a slash in this case.
$ luajit 
LuaJIT 2.0.0-beta9 -- Copyright (C) 2005-2011 Mike Pall. http://luajit.org/
JIT: ON CMOV SSE2 SSE3 fold cse dce fwd dse narrow loop abc fuse
> print('test\)') 
stdin:1: invalid escape sequence near ''test'
$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print('test\)') 
test)
Could you tell me which version is correct? If LJ's is wrong, I think attached patch solves a problem.
Thanks for your attention and excuse me please for my awful language :)

Attachment: ignore-wrong-escapechar.patch
Description: Binary data


AltStyle によって変換されたページ (->オリジナル) /