Skip to content

Add support for preproc style macro's as system constants#46

Merged
Rider-Linden merged 8 commits intosecondlife:developfrom
WolfGangS:wolfgang/slua-system-constants
Dec 15, 2025
Merged

Add support for preproc style macro's as system constants#46
Rider-Linden merged 8 commits intosecondlife:developfrom
WolfGangS:wolfgang/slua-system-constants

Conversation

@WolfGangS
Copy link
Contributor

@WolfGangS WolfGangS commented Dec 10, 2025

WARNING

THIS PR SHOULD NOT BE MERGED UNTIL AFTER #41 and #42

It contains the work from those pr's as well to avoid merge conflicts

Main

This adds support to the slua preprocessing for the LSL preproc's predefined macros

This functionality is being a config switch and off by default.

When enabled an extra definition file that contains the constants is generated and loaded into luau-lsp

This pr also adds support to the lexer for luau's string interpolation, allowing macro's to be inserted into strings.

And includes test for the same. Along with an update to the preproc documentation to reflect SLua's constants support.

Example script

Source

ll.OwnerSay(__AGENTID__)

Output

ll.OwnerSay("677bf9a4-bba5-4cf9-a4ad-4802a0f7ef46")

String interpolation example

Source

ll.OwnerSay(`The scripters key is {__AGENTID__}!`)

Output

ll.OwnerSay(`The scripters key is {"677bf9a4-bba5-4cf9-a4ad-4802a0f7ef46"}!`)

Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
@Rider-Linden Rider-Linden merged commit e866f47 into secondlife:develop Dec 15, 2025
4 checks passed
@WolfGangS WolfGangS deleted the wolfgang/slua-system-constants branch December 16, 2025 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants