Skip to content
Draft
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
77 changes: 77 additions & 0 deletions generated/lua_keywords_pretty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ This file is auto-generated by https://github.com/secondlife/lsl-definitions. --
<key>tooltip</key>
<string>Luau export keyword: declares a type that can be used outside this module.</string>
</map>
<key>public</key>
<map>
<key>tooltip</key>
<string>Luau public keyword: declares a class attribute.</string>
</map>
<key>in</key>
<map>
<key>tooltip</key>
Expand Down Expand Up @@ -123,6 +128,11 @@ This file is auto-generated by https://github.com/secondlife/lsl-definitions. --
<key>tooltip</key>
<string>Read-write binary data.</string>
</map>
<key>class</key>
<map>
<key>tooltip</key>
<string>Shared methods and attributes available to object instances.</string>
</map>
<key>never</key>
<map>
<key>tooltip</key>
Expand All @@ -133,6 +143,11 @@ This file is auto-generated by https://github.com/secondlife/lsl-definitions. --
<key>tooltip</key>
<string>Double‑precision floating point number.</string>
</map>
<key>object</key>
<map>
<key>tooltip</key>
<string>Instance of a class.</string>
</map>
<key>string</key>
<map>
<key>tooltip</key>
Expand Down Expand Up @@ -12900,6 +12915,68 @@ Returns true if result is non-zero.</string>
<key>tooltip</key>
<string>Writes an unsigned 8-bit integer to the buffer at the given offset.</string>
</map>
<key>class</key>
<map>
<key>energy</key>
<real>-1.0</real>
<key>tooltip</key>
<string>Class/object manipulation library.</string>
</map>
<key>class.classof</key>
<map>
<key>arguments</key>
<array>
<map>
<key>obj</key>
<map>
<key>tooltip</key>
<string>Object to get the class of.</string>
<key>type</key>
<string>unknown</string>
</map>
</map>
</array>
<key>energy</key>
<real>10.0</real>
<key>return</key>
<string>class?</string>
<key>sleep</key>
<real>0.0</real>
<key>tooltip</key>
<string>Returns the class of the given object, or nil if not a class.</string>
</map>
<key>class.instanceof</key>
<map>
<key>arguments</key>
<array>
<map>
<key>obj</key>
<map>
<key>tooltip</key>
<string>Object to check the class of.</string>
<key>type</key>
<string>unknown</string>
</map>
</map>
<map>
<key>cls</key>
<map>
<key>tooltip</key>
<string>Class to check against.</string>
<key>type</key>
<string>class</string>
</map>
</map>
</array>
<key>energy</key>
<real>10.0</real>
<key>return</key>
<string>boolean</string>
<key>sleep</key>
<real>0.0</real>
<key>tooltip</key>
<string>Returns true if obj is an instance of the given class.</string>
</map>
<key>coroutine</key>
<map>
<key>energy</key>
Expand Down
10 changes: 10 additions & 0 deletions generated/secondlife.d.luau
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,16 @@ declare buffer: {
}


---------------------------
-- Global Table: class
---------------------------

declare class: {
classof: @checked (obj: unknown) -> class?,
instanceof: @checked (obj: unknown, cls: class) -> boolean,
}


---------------------------
-- Global Table: coroutine
---------------------------
Expand Down
9 changes: 9 additions & 0 deletions generated/secondlife.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@
"documentation": "Writes up to 32 bits to the buffer at the given offset.",
"learn_more_link": "https://create.roblox.com/docs/reference/engine/libraries/buffer#writebits"
},
"@sl-slua/global/class": {
"documentation": "Class/object manipulation library."
},
"@sl-slua/global/class.classof": {
"documentation": "Returns the class of the given object, or nil if not a class."
},
"@sl-slua/global/class.instanceof": {
"documentation": "Returns true if obj is an instance of the given class."
},
"@sl-slua/global/coroutine": {
"documentation": "Coroutine manipulation library.",
"learn_more_link": "https://luau.org/library/#coroutine-library"
Expand Down
11 changes: 11 additions & 0 deletions generated/secondlife_selene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5389,6 +5389,17 @@ globals:
- type: number
- type: number
description: Writes up to 32 bits to the buffer at the given offset.
class.classof:
args:
- type: any
must_use: true
description: Returns the class of the given object, or nil if not a class.
class.instanceof:
args:
- type: any
- type: any
must_use: true
description: Returns true if obj is an instance of the given class.
coroutine.create:
args:
- type: function
Expand Down
6 changes: 3 additions & 3 deletions generated/syntax/slua.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@
<key>name</key>
<string>support.function.luau</string>
<key>match</key>
<string>(?&lt;![^.]\.|:)\b(bit32\.(?:arshift|band|bnot|bor|btest|bxor|byteswap|countlz|countrz|extract|lrotate|lshift|replace|rrotate|rshift|s32|smul)|buffer\.(?:copy|create|fill|fromstring|len|readbits|readf32|readf64|readi16|readi32|readi8|readstring|readu16|readu32|readu8|tostring|writebits|writef32|writef64|writei16|writei32|writei8|writestring|writeu16|writeu32|writeu8)|coroutine\.(?:close|create|isyieldable|resume|running|status|wrap|yield)|debug\.(?:info|traceback)|llbase64\.(?:decode|encode)|lljson\.(?:decode|encode|sldecode|slencode)|llprim\.(?:setMedia|setParticleSystem)|math\.(?:abs|acos|asin|atan|atan2|ceil|clamp|cos|cosh|deg|exp|floor|fmod|frexp|isfinite|isinf|isnan|ldexp|lerp|log|log10|map|max|min|modf|noise|pow|rad|random|randomseed|round|sign|sin|sinh|sqrt|tan|tanh)|os\.(?:clock|date|difftime|time)|quaternion\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|rotation\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|string\.(?:byte|char|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|split|sub|unpack|upper)|table\.(?:append|clear|clone|concat|create|extend|find|foreach|foreachi|freeze|getn|insert|isfrozen|maxn|move|pack|remove|shrink|sort|unpack)|utf8\.(?:char|codepoint|codes|len|offset)|uuid\.(?:create)|vector\.(?:abs|angle|ceil|clamp|create|cross|dot|floor|lerp|magnitude|max|min|normalize|sign))\b</string>
<string>(?&lt;![^.]\.|:)\b(bit32\.(?:arshift|band|bnot|bor|btest|bxor|byteswap|countlz|countrz|extract|lrotate|lshift|replace|rrotate|rshift|s32|smul)|buffer\.(?:copy|create|fill|fromstring|len|readbits|readf32|readf64|readi16|readi32|readi8|readstring|readu16|readu32|readu8|tostring|writebits|writef32|writef64|writei16|writei32|writei8|writestring|writeu16|writeu32|writeu8)|class\.(?:classof|instanceof)|coroutine\.(?:close|create|isyieldable|resume|running|status|wrap|yield)|debug\.(?:info|traceback)|llbase64\.(?:decode|encode)|lljson\.(?:decode|encode|sldecode|slencode)|llprim\.(?:setMedia|setParticleSystem)|math\.(?:abs|acos|asin|atan|atan2|ceil|clamp|cos|cosh|deg|exp|floor|fmod|frexp|isfinite|isinf|isnan|ldexp|lerp|log|log10|map|max|min|modf|noise|pow|rad|random|randomseed|round|sign|sin|sinh|sqrt|tan|tanh)|os\.(?:clock|date|difftime|time)|quaternion\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|rotation\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|string\.(?:byte|char|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|split|sub|unpack|upper)|table\.(?:append|clear|clone|concat|create|extend|find|foreach|foreachi|freeze|getn|insert|isfrozen|maxn|move|pack|remove|shrink|sort|unpack)|utf8\.(?:char|codepoint|codes|len|offset)|uuid\.(?:create)|vector\.(?:abs|angle|ceil|clamp|create|cross|dot|floor|lerp|magnitude|max|min|normalize|sign))\b</string>
</dict>
<dict>
<key>name</key>
Expand All @@ -645,7 +645,7 @@
<key>name</key>
<string>support.constant.luau</string>
<key>match</key>
<string>(?&lt;![^.]\.|:)\bbit32|buffer|coroutine|debug|ll|llbase64|llcompat|lljson(\.array_mt|empty_array|empty_object|null|object_mt|remove)?|llprim(\.ParamsSetter)?|math(\.huge|pi)?|os|quaternion(\.identity)?|rotation(\.identity)?|string|table|utf8(\.charpattern)?|uuid|vector(\.one|zero)?\b</string>
<string>(?&lt;![^.]\.|:)\bbit32|buffer|class|coroutine|debug|ll|llbase64|llcompat|lljson(\.array_mt|empty_array|empty_object|null|object_mt|remove)?|llprim(\.ParamsSetter)?|math(\.huge|pi)?|os|quaternion(\.identity)?|rotation(\.identity)?|string|table|utf8(\.charpattern)?|uuid|vector(\.one|zero)?\b</string>
</dict>
<dict>
<key>name</key>
Expand Down Expand Up @@ -1278,7 +1278,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(nil|any|boolean|buffer|never|number|string|thread|unknown|quaternion|uuid|vector|DetectedEvent|rotation|list|DateTypeArg|DateTypeResult|ParticleParams|MediaParams|HttpRequestParams)\b</string>
<string>\b(nil|any|boolean|buffer|class|never|number|object|string|thread|unknown|quaternion|uuid|vector|DetectedEvent|rotation|list|DateTypeArg|DateTypeResult|ParticleParams|MediaParams|HttpRequestParams)\b</string>
<key>name</key>
<string>support.type.primitive.luau</string>
</dict>
Expand Down
6 changes: 3 additions & 3 deletions generated/syntax/slua.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
},
{
"name": "support.function.luau",
"match": "(?<![^.]\\.|:)\\b(bit32\\.(?:arshift|band|bnot|bor|btest|bxor|byteswap|countlz|countrz|extract|lrotate|lshift|replace|rrotate|rshift|s32|smul)|buffer\\.(?:copy|create|fill|fromstring|len|readbits|readf32|readf64|readi16|readi32|readi8|readstring|readu16|readu32|readu8|tostring|writebits|writef32|writef64|writei16|writei32|writei8|writestring|writeu16|writeu32|writeu8)|coroutine\\.(?:close|create|isyieldable|resume|running|status|wrap|yield)|debug\\.(?:info|traceback)|llbase64\\.(?:decode|encode)|lljson\\.(?:decode|encode|sldecode|slencode)|llprim\\.(?:setMedia|setParticleSystem)|math\\.(?:abs|acos|asin|atan|atan2|ceil|clamp|cos|cosh|deg|exp|floor|fmod|frexp|isfinite|isinf|isnan|ldexp|lerp|log|log10|map|max|min|modf|noise|pow|rad|random|randomseed|round|sign|sin|sinh|sqrt|tan|tanh)|os\\.(?:clock|date|difftime|time)|quaternion\\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|rotation\\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|string\\.(?:byte|char|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|split|sub|unpack|upper)|table\\.(?:append|clear|clone|concat|create|extend|find|foreach|foreachi|freeze|getn|insert|isfrozen|maxn|move|pack|remove|shrink|sort|unpack)|utf8\\.(?:char|codepoint|codes|len|offset)|uuid\\.(?:create)|vector\\.(?:abs|angle|ceil|clamp|create|cross|dot|floor|lerp|magnitude|max|min|normalize|sign))\\b"
"match": "(?<![^.]\\.|:)\\b(bit32\\.(?:arshift|band|bnot|bor|btest|bxor|byteswap|countlz|countrz|extract|lrotate|lshift|replace|rrotate|rshift|s32|smul)|buffer\\.(?:copy|create|fill|fromstring|len|readbits|readf32|readf64|readi16|readi32|readi8|readstring|readu16|readu32|readu8|tostring|writebits|writef32|writef64|writei16|writei32|writei8|writestring|writeu16|writeu32|writeu8)|class\\.(?:classof|instanceof)|coroutine\\.(?:close|create|isyieldable|resume|running|status|wrap|yield)|debug\\.(?:info|traceback)|llbase64\\.(?:decode|encode)|lljson\\.(?:decode|encode|sldecode|slencode)|llprim\\.(?:setMedia|setParticleSystem)|math\\.(?:abs|acos|asin|atan|atan2|ceil|clamp|cos|cosh|deg|exp|floor|fmod|frexp|isfinite|isinf|isnan|ldexp|lerp|log|log10|map|max|min|modf|noise|pow|rad|random|randomseed|round|sign|sin|sinh|sqrt|tan|tanh)|os\\.(?:clock|date|difftime|time)|quaternion\\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|rotation\\.(?:conjugate|create|dot|magnitude|normalize|slerp|tofwd|toleft|toup)|string\\.(?:byte|char|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|split|sub|unpack|upper)|table\\.(?:append|clear|clone|concat|create|extend|find|foreach|foreachi|freeze|getn|insert|isfrozen|maxn|move|pack|remove|shrink|sort|unpack)|utf8\\.(?:char|codepoint|codes|len|offset)|uuid\\.(?:create)|vector\\.(?:abs|angle|ceil|clamp|create|cross|dot|floor|lerp|magnitude|max|min|normalize|sign))\\b"
},
{
"name": "support.function.luau",
Expand All @@ -378,7 +378,7 @@
},
{
"name": "support.constant.luau",
"match": "(?<![^.]\\.|:)\\b(bit32|buffer|coroutine|debug|ll|llbase64|llcompat|lljson(\\.array_mt|empty_array|empty_object|null|object_mt|remove)?|llprim(\\.ParamsSetter)?|math(\\.huge|pi)?|os|quaternion(\\.identity)?|rotation(\\.identity)?|string|table|utf8(\\.charpattern)?|uuid|vector(\\.one|zero)?)\\b"
"match": "(?<![^.]\\.|:)\\b(bit32|buffer|class|coroutine|debug|ll|llbase64|llcompat|lljson(\\.array_mt|empty_array|empty_object|null|object_mt|remove)?|llprim(\\.ParamsSetter)?|math(\\.huge|pi)?|os|quaternion(\\.identity)?|rotation(\\.identity)?|string|table|utf8(\\.charpattern)?|uuid|vector(\\.one|zero)?)\\b"
},
{
"name": "support.constant.luau",
Expand Down Expand Up @@ -785,7 +785,7 @@
"name": "constant.language.boolean.true.luau"
},
{
"match": "\\b(nil|any|boolean|buffer|never|number|string|thread|unknown|quaternion|uuid|vector|DetectedEvent|rotation|list|DateTypeArg|DateTypeResult|ParticleParams|MediaParams|HttpRequestParams)\\b",
"match": "\\b(nil|any|boolean|buffer|class|never|number|object|string|thread|unknown|quaternion|uuid|vector|DetectedEvent|rotation|list|DateTypeArg|DateTypeResult|ParticleParams|MediaParams|HttpRequestParams)\\b",
"name": "support.type.primitive.luau"
},
{
Expand Down
30 changes: 30 additions & 0 deletions slua_definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,30 @@ modules:
type: number
return-type: ()
typechecker: {checked: true}
- name: class
comment: Class/object manipulation library.
functions:
- name: classof
comment: Returns the class of the given object, or nil if not a class.
parameters:
- name: obj
comment: Object to get the class of.
type: unknown
return-type: class?
must-use: true
typechecker: {checked: true}
- name: instanceof
comment: Returns true if obj is an instance of the given class.
parameters:
- name: obj
comment: Object to check the class of.
type: unknown
- name: cls
comment: Class to check against.
type: class
return-type: boolean
must-use: true
typechecker: {checked: true}
- name: coroutine
comment: Coroutine manipulation library.
functions:
Expand Down Expand Up @@ -3134,6 +3158,8 @@ controls:
tooltip: "Lua local keyword: declares a local variable or function."
export:
tooltip: "Luau export keyword: declares a type that can be used outside this module."
public:
tooltip: "Luau public keyword: declares a class attribute."
in:
tooltip: "Lua in keyword: used in generic for loops to iterate over elements."
not:
Expand All @@ -3149,10 +3175,14 @@ builtin-types:
tooltip: "Boolean: represents a true or false value."
buffer:
tooltip: Read-write binary data.
class:
tooltip: Shared methods and attributes available to object instances.
never:
tooltip: The empty type that contains no values.
number:
tooltip: Double‑precision floating point number.
object:
tooltip: Instance of a class.
string:
tooltip: Read-only binary data. Usually UTF-8-encoded text.
thread:
Expand Down
Loading