Skip to content

Textmate Syntax file generation for LSL and SLua - #120

Merged
HaroldCindy merged 34 commits into
secondlife:mainfrom
WolfGangS:wolfgang/textmate
May 26, 2026
Merged

Textmate Syntax file generation for LSL and SLua#120
HaroldCindy merged 34 commits into
secondlife:mainfrom
WolfGangS:wolfgang/textmate

Conversation

@WolfGangS

@WolfGangS WolfGangS commented May 8, 2026

Copy link
Copy Markdown
Contributor

Adds basic template base generation of textmate syntax files for both LSL and JSON

I chose to use template that I insert the relevant parts into instead of generating the whole document in a schema, as that would be ALLOT more code, unless more libraries were introduced and i am under the impression less dependencies and so forth is better, due to places this may need to be run.

Closes #9

Comment thread gen_all_definitions.sh Outdated
@WolfGangS

This comment was marked as resolved.

Comment thread slua_definitions.schema.json Outdated
Comment thread slua_definitions.schema.json Outdated
Comment thread slua_definitions.schema.json Outdated
Comment thread slua_definitions.yaml Outdated
Comment thread slua_definitions.yaml Outdated
Comment thread slua_definitions.yaml Outdated
Comment thread lsl_definitions/generators/textmate.py Outdated
Comment thread lsl_definitions/generators/textmate.py Outdated
Comment thread lsl_definitions/generators/textmate.py
Comment thread templates/syntax/slua.tmLanguage.json Outdated
Comment thread templates/syntax/slua.tmLanguage Outdated
Comment thread lsl_definitions/generators/textmate.py
Comment thread lsl_definitions/generators/textmate.py Outdated
Comment thread lsl_definitions/generators/textmate.py Outdated
Comment thread templates/syntax/lsl.tmLanguage
Comment thread lsl_definitions/generators/textmate.py Outdated
Comment thread gen_all_definitions.sh
Comment thread generated/syntax/slua.tmLanguage
Comment thread templates/syntax/slua.tmLanguage
WolfGangS and others added 11 commits May 13, 2026 11:52
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>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Co-authored-by: Tapple Gao <tapplek@gmail.com>
Co-authored-by: Tapple Gao <tapplek@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
@@ -0,0 +1,398 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you sanity checked these files in a textmate highlighter? I don't know how to do that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Slua one is already in use here, https://slua-playground.wlf.io

Tested the lsl one mostly using https://www.leskoff.com/s02050-0 probably need a cleaner solution but that was fast an simple 😝

Comment thread lsl_definitions/slua.py Outdated
Comment thread lsl_definitions/generators/textmate.py Outdated
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Comment thread templates/syntax/lsl.tmLanguage.json Outdated
WolfGangS added 2 commits May 13, 2026 14:39
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Comment thread templates/syntax/lsl.tmLanguage.json Outdated
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Comment thread generated/syntax/lsl.tmLanguage Outdated
WolfGangS and others added 4 commits May 13, 2026 17:22
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
Comment thread templates/syntax/LICENSE.md Outdated
Signed-off-by: WolfGangS <flamin2k8@gmail.com>

@HaroldCindy HaroldCindy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on!

In general, it looks alright. There's certainly a lot of wonkiness with the nested functions inside other functions, but that's not anything we don't do elsewhere.

I imagine some of that could be abstracted out but... this is a repo for (mostly) straightforward codegen with deterministic outputs. So long as the generated code looks fine, the codegen code can have some warts :)

I do have a few comments though, lmk if there's anything I can clarify!

Comment thread lsl_definitions/generators/textmate.py Outdated
Comment thread lsl_definitions/generators/textmate.py Outdated
Comment thread lsl_definitions/generators/textmate.py
Comment thread lsl_definitions/slua.py

### Licenses

Copyright (c) JohnnyMorganz All rights reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The easiest way to comply with the license is to shove them into comments in the output .tmLanguage, rather than just linking them. I believe it would be sufficient to say "Based on , Copyright (year) (so and so) - MIT license" in the relevant plist comments since the body of the MIT license is already shipped with this repo.

@tapple tapple May 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was like that. WolfGang changed it as the attribution was getting a bit long: c645623. I'm happy either way

@HaroldCindy HaroldCindy May 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the MIT license is fairly explicit about this. If we ever give someone a copy of the tmLanguage file separately from this repo (which we will, through the JSON-RPC bridge), we need to include a copy of the full MIT license and the relevant copyright holders to be compliant.

It's why you get dozens of pages about zlib and curl license information in the credits of various games.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added: d2df52c

It only seemed to be a requirement of the slua files, not lsl files, so I didn't change the lsl files

Comment thread slua_definitions.schema.json
Comment thread slua_definitions.yaml
Comment thread lsl_definitions/generators/textmate.py Outdated
WolfGangS added 2 commits May 20, 2026 18:42
Signed-off-by: Wolfgang <wolfgang@wlf.io>
Signed-off-by: Wolfgang <wolfgang@wlf.io>
Comment thread generated/syntax/lsl.tmLanguage

@HaroldCindy HaroldCindy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Just one pending note about including the third-party license details in the files where they're relevant and this should be good to merge.

@HaroldCindy
HaroldCindy merged commit 538ba89 into secondlife:main May 26, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TextMate Grammar for Linden Scripting Language (LSL)

4 participants