lua-users home
lua-l archive

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



On 10/6/23 07:59, Родион Горковенко wrote:
Perhaps, provide a small straightforward example please? E.g. here are
7 nesting levels

b={{{{{{{5}}}}}}}
for i=1,7 do b=b[1]; print('level #' .. i, b) end

and it looks like working in 5.4.6
https://rodiongork.github.io/lua-emcc/#b64:Yj17e3t7e3t7NX19fX19fX0KZm9yIGk9MSw3IGRvIGI9YlsxXTsgcHJpbnQoJ2xldmVsICMnIC4uIGksIGIpIGVuZA==
I can confirm that it works in 5.4.4 . Below Linux Mint 21.2 Xfce Terminal session:
```
~ $ lua5.4
Lua 5.4.4  Copyright (C) 1994-2022 Lua.org, PUC-Rio
> b={{{{{{{{{{{{{{{{{5}}}}}}}}}}}}}}}}}
for i=1,17 do b=b[1]; print('level #' .. i, b) end
level #1    table: 0x556b02798fe0
level #2    table: 0x556b027993b0
level #3    table: 0x556b02799410
level #4    table: 0x556b02799470
level #5    table: 0x556b027994d0
level #6    table: 0x556b02799530
level #7    table: 0x556b02799590
level #8    table: 0x556b027995f0
level #9    table: 0x556b02799650
level #10    table: 0x556b027996b0
level #11    table: 0x556b02799710
level #12    table: 0x556b02799770
level #13    table: 0x556b027997d0
level #14    table: 0x556b02799830
level #15    table: 0x556b02799890
level #16    table: 0x556b027963c0
level #17    5
```
But most probably I failed to grasp where or under which conditions
"parsing" fails?

Thanks in advance!

I've faced the case of inability to parse the big and nested tables.
Unfortunately only 5 nesting levels may be parsed for sure, which seems
to be too little for so wonderful language as Lua is :-)