From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 28FF46EC5D; Wed, 7 Apr 2021 19:31:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 28FF46EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617813086; bh=s+pUnXAdk5XGPtfP/8ux9QmlUPDMM0j/wi0paFZIXOs=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=CRsPTo345P8XeH2LSWz+97cG72BLH6++zTiWPY7gtkhXTj7cX3vEMbJxj9mPJLOkI gX61nXP8a3FZcBixAq2J9qwZd31cZL/bspmUEtap3CmLqrV4ThQ/bBZaxSDpUQIpQb yuIu97XwNJCYgxDIfawRySmYYDIHlHY30h023PXs= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 02D056EC5D for ; Wed, 7 Apr 2021 19:31:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 02D056EC5D Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lUB5P-0002z1-SE; Wed, 07 Apr 2021 19:31:24 +0300 Date: Wed, 7 Apr 2021 19:31:13 +0300 To: Sergey Kaplun Message-ID: <20210407163113.GO29703@tarantool.org> References: <20210330221631.GA29703@tarantool.org> <20210406213704.GL29703@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC1FED631623C873017929456591B90F20100894C459B0CD1B9E3A30D3667AB217BB9CD398CF969EC14264CEB74278BE38A261E30AE1A3D8EFE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FBB2043146276655EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E16D8B060A9A23898638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2DECAD26D9A6A23CBE706AEED4489C4EEEABCB1FA743BAAB4D2E47CDBA5A96583C09775C1D3CA48CFCA5A41EBD8A3A0199FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C317B107DEF921CE79117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637D465FD7187F8F5C4EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5F4D3F686C174BAFAC1FF9B853E68BB8BEC4AF932FE1F19FFD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C264B329661203DA5BB086DC24A5C5727A9B8554681FEAB08B862F09E629E23F88CBFDAFC7D7B0531D7E09C32AA3244C7A95D66B85550125F93E0E945E8A600BF522A1CF68F4BE05927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioju+jaMfvANXoFEHF0hJ1Y9Q== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822BA636B687B72CA7EAFE4F96D0377E15EA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 16/30] test: adapt PUC Lua test for %q in fmt for LuaJIT X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, On 07.04.21, Sergey Kaplun wrote: > Igor, > > > > > > string.format(): %q reversible. > > > > > See also https://luajit.org/extensions.html#lua52. > > > > > > > > > > In Lua 5.1 string.format() does not accept string values containing > > > > > embedded zeros, except as arguments to the '%q' option. > > > > > In Lua 5.2 '\0' is not handled differently from other > > > > > control chars in string.format('%q', ...). > > > > > See commit 7cc981c14067d4b0e774a6bfb0acfc2f5c911f0d > > > > > (string.format("%q", str) is now fully reversible > > > > > (from Lua 5.2).). > > > > > > > > Well, I honestly don't understand what is changed in *semantics*. I've > > > > tried the following command with Lua 5.2, Lua 5.1 and LuaJIT 2.0.5 as an > > > > interpreter being tested > > > > | -e 'print(string.format("%q", "\0"))' > > > > > > > > I understand the semantics of "%q", but was it just a bug in Lua 5.1? > > > > > > A bug with the test for it??? > > > > Well, I can remind you the bug with we fixed the last year. > > There might be no test for it though, but all in all it has not been > > fixed in Lua 5.1. > > I mean that this behaviour is verificated by the test. When behaviour is > changed the test is changed too. > > > > > > > > > > What does "fully reversible" mean in this context? > > > > This question is left unaddressed. > > I don't know what does Mike mean by these. Then it would be great to describe the changes on your own. I can hardly split the comment into yours words and ones taked from Lua Reference manual or git log, but you are writing that "In Lua 5.2 '\0' is not handled differently from other control chars". Could you please clarify the difference you are talking about? Or provide the links describing it? May be some parts from PIL? > > > > > > > > > > > I understand only the fact the behaviour differs and you reimplemented > > > > the test assertion according to Lua 5.2 testing suite. That's all. > > > > > > > > I found not a single word regarding this issue in Lua bugs[1] page, > > > > except invalid handling of \r[2]. Is there any issue/page with a more > > > > > > It looks unrelated to these changes. > > > > > > > verbose explanation what has been changed in 7cc981c? > > > > > > I just read these lines in Lua 5.1 reference manual :): > > > | This function does not accept string values containing embedded > > > | zeros, except as arguments to the q option. > > > > So what? This means literally nothing to me... BTW, I can pass such > > string to the function and it can yield any bullshit the developer > > wanted to. That's why we decided to comment such places in a clear and > > verbose way, didn't we? > > Don't get you point here. AFAIU it means that `%q` is the only one > option that can contain embeded zeros, so it handles it in the special > way. My point relates to the fact, nobody except you can understand the comment near the change. Hence one need to make the similar investigation you made. Then what is the sense of commenting the changes in suite? > > > > > > > > > As for me, it is just new behaviour of Lua 5.2 -- patterns now accept > > > '\0' as a reqular character (see > > > 4541243355a299a9b75042d207feb87295872c3a (patterns now accept '\0' as a > > > regular character) from Lua repository). So, according to commit > > > 658ea8752b979102627e2fede7b7ddfbb67ba6c9 (no need to handle '\0' > > > differently from other control chars in format '%q')) from Lua > > > repository, this behaviour is excess. > > > > > > Also, it is mentioned here [2]. > > > > I see nothing regarding this change there. > > I am talking about this part: > > | Character class %z in patterns is deprecated, as now patterns may > | contain '\0' as a regular character. Patterns, not options, right? > > > > > [1]: https://www.lua.org/bugs.html#5.1 > > > > [2]: https://www.lua.org/bugs.html#5.1-4 > > > > > > > > -- > > > > Best regards, > > > > IM > > > > > > [1]: https://www.lua.org/manual/5.1/manual.html#pdf-string.format > > > [2]: https://www.lua.org/manual/5.2/manual.html#8.2 > > -- > Best regards, > Sergey Kaplun -- Best regards, IM