Git Product home page Git Product logo

Comments (11)

sumneko avatar sumneko commented on August 22, 2024 2

Yes, the next feature in plan is to support multi lua version.

from lua-language-server.

z16 avatar z16 commented on August 22, 2024

That's great news! Will that include LuaJIT? As it has a few syntactic changes that the current parser can't handle:
image

from lua-language-server.

sumneko avatar sumneko commented on August 22, 2024

LuaJIT is also in plan, but not include in next feature. I've never used LuaJIT before, so I need to study the grammar of LuaJIT first.

from lua-language-server.

z16 avatar z16 commented on August 22, 2024

That's fine, great to know you're still considering it. The grammar changes are very minor compared to regular Lua. I believe that the whole extent of the changes is mentioned here: http://luajit.org/extensions.html

from lua-language-server.

sumneko avatar sumneko commented on August 22, 2024

@z16 Could you please tell me the syntactic changes of LuaJIT? I didn't find them in http://luajit.org/extensions.html, for example 0ULL.

Is _VERSION == 'Lua 5.1' in LuaJIT?

from lua-language-server.

z16 avatar z16 commented on August 22, 2024

The only changes to the parser that I'm aware of are mentioned at the very bottom of this page:
http://luajit.org/ext_ffi_api.html

To quote:


Extensions to the Lua Parser

The parser for Lua source code treats numeric literals with the suffixes LL or ULL as signed or unsigned 64 bit integers. Case doesn't matter, but uppercase is recommended for readability. It handles both decimal (42LL) and hexadecimal (0x2aLL) literals.

The imaginary part of complex numbers can be specified by suffixing number literals with i or I, e.g. 12.5i. Caveat: you'll need to use 1i to get an imaginary part with the value one, since i itself still refers to a variable named i.


And yes to the other question:

z16@DESKTOP-MRD0N1S:~$ luajit
LuaJIT 2.0.2 -- Copyright (C) 2005-2013 Mike Pall. http://luajit.org/
JIT: ON CMOV SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse
> =_VERSION
Lua 5.1

from lua-language-server.

sumneko avatar sumneko commented on August 22, 2024

Thank you!

from lua-language-server.

z16 avatar z16 commented on August 22, 2024

Just wanted to say that I tried it, and it works great!

The only thing is... we currently use the LuaJIT 2.1 beta, and it supports Lua 5.3's unicode literals:
image

This is only for LuaJIT 2.1. Would it be possible to also add support for that version?

I think that's the only syntax difference between the two. Since it's still a beta, it's not final, but it has been in beta for a few years now, and I don't know when it will be released, so I would prefer not to wait, if possible :)

Here are some documentation pages for the 2.1 beta, if it helps:
https://htmlpreview.github.io/?https://github.com/LuaJIT/LuaJIT/blob/v2.1/doc/extensions.html
https://htmlpreview.github.io/?https://github.com/LuaJIT/LuaJIT/blob/v2.1/doc/ext_ffi_api.html

from lua-language-server.

sumneko avatar sumneko commented on August 22, 2024

Is there any other issue with this feature?

from lua-language-server.

z16 avatar z16 commented on August 22, 2024

Not that I noticed, everything else seems good so far.

from lua-language-server.

sumneko avatar sumneko commented on August 22, 2024

Feedback is welcome if you find any problems.

from lua-language-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.