Closed Shiranuit closed 1 year ago
Fixes the issue #51
This PR tries to reduce inconsistency with the table length operator and be closer to the PUC Lua implementation.
Sorry I didn't add new test cases somehow I wasn't able to make them work on my side.
Actual version
print(#{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,nil,17,18,[33]={}}) -- 33 print(#{1,2,3,nil,5,nil,nil,8,9}) -- 5 print(#{1,2,3,nil,5,nil,7,8}) -- 3 print(#{1,2,3,nil,5,nil,7,8,9}) -- 9 print(#{1,nil,[2]=2,3}) -- 1
New Version
print(#{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,nil,17,18,[33]={}}) -- 18 print(#{1,2,3,nil,5,nil,nil,8,9}) -- 9 print(#{1,2,3,nil,5,nil,7,8}) -- 8 print(#{1,2,3,nil,5,nil,7,8,9}) -- 9 print(#{1,nil,[2]=2,3}) -- 3
PUC Lua Reference
Amazing, thank you! Will add a couple of tests this evening!
Thank you so much!
What does this PR do ?
Fixes the issue #51
This PR tries to reduce inconsistency with the table length operator and be closer to the PUC Lua implementation.
Sorry I didn't add new test cases somehow I wasn't able to make them work on my side.
Actual version
New Version
PUC Lua Reference