Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Tweaking things to work with LSL Forge files #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions grammars/lsl.cson
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'name': 'LSL'
'scopeName': 'source.lsl'
'fileTypes': [
'lsl'
'lsl', 'lslp', 'lslm'
]
'patterns': [
{ 'include': '#value' }
Expand Down Expand Up @@ -61,6 +61,18 @@
'name': 'punctuation.definition.comment.lsl'
'match': '(//).*$\\n?'
'name': 'comment.line.double-slash.lsl'
'pragma_inline':
Copy link
Contributor

Choose a reason for hiding this comment

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

@furroy I don't understand the changes you propose here.

One the one hand you suggest captures groups for the match for pragma_inline, on the other you assign the whole match a scope name. Additionally your regex doesn't have groups at all, so referencing a captures: 1: ... group doesn't make sense.

Same with modules.

Copy link
Author

Choose a reason for hiding this comment

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

I just tweaked similar examples I found online and worked for me. Maybe they don't follow some sort of best practices, but I've not had any issues with these changes.

'captures':
'1':
'name': 'punctuation.definition.comment.lsl'
'match': '^//\\s*pragma inline\\s*$\\n?'
'name': 'entity.name.function.lsl'
'module':
'captures':
'1':
'name': 'punctuation.definition.module.lsl'
'match': '^\\$.*$\\n?'
'name': 'entity.name.function.lsl'
'constant':
'patterns': [ {
'match': '\\b(default|state)\\b'
Expand Down Expand Up @@ -208,7 +220,7 @@
}
]
'operator':
'patterns': [
'patterns': [
{
'name': 'keyword.operator.increment.lsl'
'match': '\\+\\+'
Expand Down Expand Up @@ -370,6 +382,8 @@
'name': 'storage.type.lsl'
'value':
'patterns': [
{ 'include': '#pragma_inline' }
{ 'include': '#module' }
{ 'include': '#commentblock' }
{ 'include': '#commentline' }
{ 'include': '#state' }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "language-lsl",
"version": "2.2.0",
"private": false,
"description": "A Linden Scripting Language package for Atom",
"description": "A Linden Scripting Language package for Atom. Tweaked for LSL Forge.",
"homepage": "https://atom.io/packages/language-lsl/",
"repository": {
"type": "git",
Expand Down