-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSL - Linden Script Language #253
Conversation
Adding LSL language
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Folder name should be autoCompletion
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing unit test for the function list.
functionList/LSL_byKimpaTammas.xml
Outdated
</className> | ||
<function | ||
mainExpr="(?x)(?:\b(state_(?:entry|exit)|touch(?:_(?:start|end))?|(?:land_)?collision(?:_(?:start|end))?|timer|listen|(?:no_)?sensor|control|(?:not_)?at_(?:rot_)?target|money|email|experience_permissions(?:_denied)?|run_time_permissions|changed|attach|dataserver|moving_(?:start|end)|linkset_data|link_message|(?:on|object)_rez|remote_data|http_re(?:sponse|quest)|path_update|transaction_result)\b)\s*(?:\((?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+(?:[A-Za-z_]\w*))\b(?:\s*,\s*(?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+(?:[A-Za-z_]\w*))\b))*)?\))(?=\s*\{)" | ||
openSymbole="\{" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attributes openSymbole
and closeSymbole
are not supported for function
-nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these "not supported" (ie, it can be there, but Notepad++ does nothing with it), or "not allowed" (ie, it shouldn't be there at all)? Because if it's truly just "not supported but allowed-and-ignored", then I need to change the XSD to make it allowed.
functionList/LSL_byKimpaTammas.xml
Outdated
</classRange> | ||
<function | ||
mainExpr="(?x)(?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+)?([A-Za-z_]\w*)\b)\s*\((?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+(?:[A-Za-z_]\w*))\b(?:\s*,\s*(?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+(?:[A-Za-z_]\w*))\b))*)?\)(?=\s*\{)" | ||
openSymbole="\{" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attributes openSymbole
and closeSymbole
are not supported for function
-nodes.
functionList/LSL_byKimpaTammas.xml
Outdated
mainExpr="(?x)(?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+)?([A-Za-z_]\w*)\b)\s*\((?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+(?:[A-Za-z_]\w*))\b(?:\s*,\s*(?:\b(?:(?:float|integer|key|list|quaternion|rotation|string|vector)\s+(?:[A-Za-z_]\w*))\b))*)?\)(?=\s*\{)" | ||
openSymbole="\{" | ||
closeSymbole="\}" | ||
displayMode="$functionName" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The displayMode
is not supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it "not supported" (ie, it can be there, but Notepad++ does nothing with it), or "not allowed" (ie, it shouldn't be there at all)? Because the User Manual says that the <function>
and <classRange>
elements both have that attribute, but it's "reserved for future use". And, for example, your vb-3.0.FL.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be there, but Notepad++ does nothing with it.
And, for example, your vb-3.0.FL.xml
My Languages repository is far from up-to-date. I tend to remove the attributes, etc. that are not currently used, add comment and reformat the XML text to accommodate the comments.
The vb-3.0.FL.xml
is an almost raw copy of a Notepad++ SourceForge topic. AFAICT I only added some comment (e.g. L_VB
and vb_function
).
> | ||
<className> | ||
<nameExpr expr="\b(?:(state)\s+(?:[A-Za-z_]\w*))\b" /> | ||
<nameExpr expr="\b(default)\b" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nameEpxr
-nodes work as consecutive filters.
The first expr
-pattern is used to find a match in any text that matched the mainExpr
.
The second expr
-pattern is used to find a match in the matched text of the first expression.
commentExpr="(?:(/\*.*?\*/)|(//.*?$))" | ||
> | ||
<classRange | ||
mainExpr="(?x)(?:\b(?:(state)\s+(?:[A-Za-z_]\w*)|(default))\b)(?=\s*\{)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superfluous parentheses around state
and around default
.
Numbered and named capturing groups are not supported.
It would probably make sense for me to rename the directory in this repo... but that rename has nothing to do with this PR. The tests fail because the XML validation used assumes that the @Kimpa-Tammas , you will need to edit the auto-completion file to start the file with the prolog and put the comment after the prolog.
I have never really looked into the function list unit tests that are performed when a function list is added to the main application -- do those unit tests require access to notepad++.exe? or are they run purely in the test framework? That is: can I easily replicate the test interface that's used in the app repo here in the UDL-specific repo? I'll create an issue for me to work on adding this unit-testing (assuming it can be easily replicated in this repo). And thank you for the detailed point-by-point commentary for the fixes that need to go in the functionList definition -- I was gonig to be asking you whether those update: actually, I'll ask for clarifications in the inline comments |
See https://github.com/notepad-plus-plus/userDefinedLanguages/actions/runs/9487334246/job/26147370232
Furthermore there is a extra |
Comments on top removed, ending tag </keyword>> fixed.
- remove `openSymbole` and `closeSymbole` from the `<function>` elements - remove `displayMode`
I grabbed On/Off Example Using States as my example file, and when I used your UDL and FunctionList for that example, I only see the Based solely on looking at the code, but not knowing anything about LSL other than the couple paragraphs I skimmed around that example code, my initial guess would have been that the FunctionList interpretation should have If you've got a better example LSL file, which shows some functions that you think should end up in the FunctionList, could you add that example LSL file as |
Pose ball LSL script sample
The color syntax is OK. Also, I added a sample script in |
Thank you for that: I can see your FunctionList working now, so I'll accept your PR. I'll actually use yours to help implement the Unit Test in #255 |
My bad, I totally missed that this is not in the Notepad++ main repository.
Yes, Notepad++ is called with the appropriate/special command line arguments. It runs "headless" and creates a JSON file which contains a representation of the
You're welcome. |
LSL Portal: https://wiki.secondlife.com/wiki/LSL_Portal