You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this feature fall under the same category of complex number representation. local a = 5i is valid only in LuaJIT and is implemented by this parser.
Lua 5.4:
Lua 5.4.2 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> a = 0b101stdin:1: malformed number near '0b101'
> a = 5istdin:1: malformed number near '5i'
LuaJIT 2.1.1720049189:
LuaJIT 2.1.1720049189 -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/JIT: ON SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
> a = 0b101
> print(a)5
> a = 5i
> print(a)0+5i
Did you check the tree-sitter docs?
Is your feature request related to a problem? Please describe.
LuaJIT 2.x support number declarations using binary representation, but Lua 5.x doesn't. So,
local a = 0b101
is valid only in LuaJIT.In the current state this parser outputs the following tree for
local a = 0b101
:Using
:InspectTree
in Neovim.Describe the solution you'd like
Handle binary representation in the same way hexadecimal representation is implemented.
A possible implementation: (This is only a suggestion)
Valid representations:
Describe alternatives you've considered
No response
Additional context
I think this feature fall under the same category of complex number representation.
local a = 5i
is valid only in LuaJIT and is implemented by this parser.Lua 5.4:
LuaJIT 2.1.1720049189:
Tree for
local a = 5i
:All LuaJIT code shown is also valid inside Neovim.
edit: Added implementation suggestion.
The text was updated successfully, but these errors were encountered: