@coalaura/luaparse-glm

1.0.6 • Public • Published

luaparse-glm

An extension to luaparse that adds support for most of FiveM's lua-glm 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.,

t?.x?.y == nil

In Unpacking:

Support for unpacking named values from tables using the in keyword, e.g,

local a,b,c in t

is functionally equivalent to:

local a,b,c = t.a,t.b,t.c

C-Style Comments:

Support for C-style block comments: /* Comment */, e.g.,

print("Hello, World!") /* Comment */

Compile Time Jenkins' Hashes:

String literals wrapped in back-ticks are Jenkins' one-at-a-time hashed when parsed.

> `Hello, World!`
1395890823

Not Implemented yet:

  • The defer statement
  • Set Constructors (t = { .a, .b })

Package Sidebar

Install

npm i @coalaura/luaparse-glm

Weekly Downloads

86

Version

1.0.6

License

ISC

Unpacked Size

5.19 kB

Total Files

6

Last publish

Collaborators

  • coalaura