<HTML><BODY>Cyrill,<br><br>Why not to move the map_direct_symbols to the module level, so that creation and <br>fill of the table will happens only once and not at every call to the output handler?<br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
Пятница, 6 сентября 2019, 0:28 +03:00 от Cyrill Gorcunov <gorcunov@gmail.com>:<br>
<br>
<div id="">
<div class="js-helper js-readmsg-msg">
<style type="text/css"></style>
<div>
<div id="style_15677189181102888183_BODY">Sole symbols (such as box.NULL) are not processed<br>
by serpent "custom" symbols feature, since they<br>
are not in table.<br>
<br>
Thus we should process them separately. Without it<br>
we have<br>
<br>
> require('console').set_default_output("lua,block")<br>
> ;<br>
> box.NULL<br>
> "cdata<void %*>: NULL";<br>
<br>
instead of<br>
<br>
> box.NULL<br>
> box.NULL;<br>
<br>
as it should be.<br>
<br>
Part-of #3834<br>
---<br>
src/box/lua/console.lua | 11 +++++++++++<br>
1 file changed, 11 insertions(+)<br>
<br>
diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua<br>
index 64086cf5b..22bafab3a 100644<br>
--- a/src/box/lua/console.lua<br>
+++ b/src/box/lua/console.lua<br>
@@ -46,6 +46,17 @@ output_handlers["lua"] = function(status, opts, ...)<br>
if not ... then<br>
return ""<br>
end<br>
+ -- Map internal symbols in case if they are<br>
+ -- not inside tables and serpent won't handle<br>
+ -- them properly.<br>
+ local map_direct_symbols = {<br>
+ [box.NULL] = 'box.NULL',<br>
+ }<br>
+ for k,v in pairs(map_direct_symbols) do<br>
+ if k == ... then<br>
+ return v<br>
+ end<br>
+ end<br>
--<br>
-- Map internal symbols which serpent doesn't know<br>
-- about to a known representation.<br>
-- <br>
2.20.1<br>
<br>
<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<br>-- <br>Sergey Ostanevich<br></BODY></HTML>