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 AEB3B6EC5D; Wed, 7 Apr 2021 18:51:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AEB3B6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617810666; bh=snG9NsvlXL/4lWse4wenRhOWdITCRLqUJdFKuPLnSPg=; 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=LvKosxkkG0WO/j1OZQBquM+et2gyiKbi75J7qVXxd9pClBP0lGK1OasXzysIJvb5A NNmyw67Rn9nrRvLQdAdmYl7GrF6fGAVCh2bbaZJS0KlVnOEbU7zCuyxe04tKTYB5qf QaH/BXMUBbO8HXO4rUfCclHwuQpCVTMJsXRPYsVI= Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (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 493366EC5D for ; Wed, 7 Apr 2021 18:51:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 493366EC5D Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1lUASO-0001ej-B0; Wed, 07 Apr 2021 18:51:04 +0300 Date: Wed, 7 Apr 2021 18:50:03 +0300 To: Igor Munkin Message-ID: References: <20210330221631.GA29703@tarantool.org> <20210406213704.GL29703@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210406213704.GL29703@tarantool.org> X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC17951DFF5B22C9C640BE5EAB58CFCE0F000894C459B0CD1B98B5AAB5F237F50CF52E232A4904862E0522A3829DAE01A794044E5D25B716109 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75644E22E05AA81AEB287FD4696A6DC2FA8DF7F3B2552694A4E2F5AFA99E116B42401471946AA11AF176DF2183F8FC7C0EEF2A6A9DCF3640F8F08D7030A58E5ADC58D69EE07B14084F39EFFDF887939037866D6147AF826D872138889F363078EF37BF5A145FF7446117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5BD2D02B924841285FB4F5DD83CD21BBF24ECECC19FA26697D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344FDECC3B9E4D57D4A90A446D9696C220A18F4FC91C9DDED67519976F72523743657BC7097A6A6E5A1D7E09C32AA3244CF1548DA312310BC55EAE12816D76ED0EB038C9161EF167A1FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioju+jaMfvANXrfFPads58U6A== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4E63C6AE16398F4D68247CF6776F3C903A4C99830201F815FF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Igor, On 07.04.21, Igor Munkin wrote: > Sergey, > > On 01.04.21, Sergey Kaplun wrote: > > Igor, > > > > Thanks for the review! > > > > On 31.03.21, Igor Munkin wrote: > > > Sergey, > > > > > > > > > > > > > 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. > > > > > > > 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. > > > > > 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. > > > > > > > > > > > > [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 -- Best regards, Sergey Kaplun