https://github.com/coalaura/luaparse-glm
Luaparse extension that supports FiveM's lua-glm.
https://github.com/coalaura/luaparse-glm
Last synced: 2 months ago
JSON representation
Luaparse extension that supports FiveM's lua-glm.
- Host: GitHub
- URL: https://github.com/coalaura/luaparse-glm
- Owner: coalaura
- Created: 2023-11-01T16:25:54.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-05T21:03:08.000Z (over 1 year ago)
- Last Synced: 2025-02-01T22:46:55.989Z (4 months ago)
- Language: JavaScript
- Homepage: https://npmjs.com/package/@coalaura/luaparse-glm
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# luaparse-glm
An extension to [luaparse](https://www.npmjs.com/package/luaparse) that adds support for most of FiveM's [lua-glm](https://github.com/citizenfx/lua/blob/luaglm-dev/cfx/README.md) runtime.
### Compound Operators:
Add ``+=, -=, *=, /=, <<=, >>=, &=, |=, and ^=`` to the language. The increment and decrement operators (``++, --``) have not been implemented due to one of those operators being reserved.### Safe Navigation:
An indexing operation that suppresses errors on accesses into undefined tables (similar to the safe-navigation operators in C#, Kotlin, etc.), e.g.,```lua
t?.x?.y == nil
```### In Unpacking:
Support for unpacking named values from tables using the ``in`` keyword, e.g,```lua
local a,b,c in t
```is functionally equivalent to:
```lua
local a,b,c = t.a,t.b,t.c
```### C-Style Comments:
Support for C-style block comments: ``/* Comment */``, e.g.,```lua
print("Hello, World!") /* Comment */
```### Compile Time Jenkins' Hashes:
String literals wrapped in back-ticks are Jenkins' one-at-a-time hashed when parsed.```lua
> `Hello, World!`
1395890823
```### Not Implemented yet:
- The defer statement
- Set Constructors (`t = { .a, .b }`)