Skip to content
Merged
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
10 changes: 5 additions & 5 deletions generated/slua_default.d.luau
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,10 @@ declare ll: {
IntegerToBase64: (Value: number) -> string,
IsFriend: (agent_id: uuid) -> boolean,
IsLinkGLTFMaterial: (link: number, face: number) -> boolean,
Json2List: (JSON: string) -> {any},
JsonGetValue: (JSON: string, Specifiers: list) -> string,
JsonSetValue: (JSON: string, Specifiers: list, Value: string) -> string,
JsonValueType: (JSON: string, Specifiers: list) -> string,
Json2List: @[deprecated {use='lljson.decode'}](JSON: string) -> {any},
JsonGetValue: @[deprecated {use='lljson.decode', reason='Also, the indices are zero-based.'}](JSON: string, Specifiers: list) -> string,
JsonSetValue: @[deprecated {use='lljson.encode', reason='Also, the indices are zero-based.'}](JSON: string, Specifiers: list, Value: string) -> string,
JsonValueType: @[deprecated {reason="Use 'lljson.decode' and 'typeof' instead. Also, the indices are zero-based."}](JSON: string, Specifiers: list) -> string,
Key2Name: (ID: uuid) -> string,
KeyCountKeyValue: () -> uuid,
KeysKeyValue: (First: number, Count: number) -> uuid,
Expand Down Expand Up @@ -727,7 +727,7 @@ declare ll: {
List2CSV: (ListVariable: list) -> string,
List2Float: (ListVariable: list, Index: number) -> number,
List2Integer: (ListVariable: list, Index: number) -> number,
List2Json: (JsonType: string, Values: list) -> string,
List2Json: @[deprecated {use='lljson.encode'}](JsonType: string, Values: list) -> string,
List2Key: (ListVariable: list, Index: number) -> uuid,
List2List: <T>(ListVariable: {T}, Start: number, End: number) -> {T},
List2ListSlice: <T>(ListVariable: {T}, Start: number, End: number, Stride: number, slice_index: number) -> {T},
Expand Down
30 changes: 30 additions & 0 deletions generated/slua_keywords_pretty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2991,6 +2991,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_APPEND</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3000,6 +3002,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_ARRAY</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3009,6 +3013,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_DELETE</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3018,6 +3024,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_FALSE</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3027,6 +3035,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_INVALID</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3036,6 +3046,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_NULL</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3045,6 +3057,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_NUMBER</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3054,6 +3068,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_OBJECT</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3063,6 +3079,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_STRING</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand All @@ -3072,6 +3090,8 @@ export type rotation = quaternion</string>
</map>
<key>JSON_TRUE</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string></string>
<key>type</key>
Expand Down Expand Up @@ -22295,6 +22315,8 @@ Returns true if result is non-zero.</string>
</map>
</map>
</array>
<key>deprecated</key>
<boolean>true</boolean>
<key>energy</key>
<real>10.0</real>
<key>return</key>
Expand Down Expand Up @@ -22327,6 +22349,8 @@ Returns true if result is non-zero.</string>
</map>
</map>
</array>
<key>deprecated</key>
<boolean>true</boolean>
<key>energy</key>
<real>10.0</real>
<key>return</key>
Expand Down Expand Up @@ -22368,6 +22392,8 @@ Returns true if result is non-zero.</string>
</map>
</map>
</array>
<key>deprecated</key>
<boolean>true</boolean>
<key>energy</key>
<real>10.0</real>
<key>return</key>
Expand Down Expand Up @@ -22400,6 +22426,8 @@ Returns true if result is non-zero.</string>
</map>
</map>
</array>
<key>deprecated</key>
<boolean>true</boolean>
<key>energy</key>
<real>10.0</real>
<key>return</key>
Expand Down Expand Up @@ -23210,6 +23238,8 @@ Returns true if result is non-zero.</string>
</map>
</map>
</array>
<key>deprecated</key>
<boolean>true</boolean>
<key>energy</key>
<real>10.0</real>
<key>return</key>
Expand Down
12 changes: 12 additions & 0 deletions generated/slua_selene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6865,17 +6865,23 @@ globals:
must_use: true
description: Checks the face for a PBR render material.
ll.Json2List:
deprecated:
message: Use 'lljson.decode' instead.
args:
- type: string
must_use: true
description: Converts the top level of the JSON string to a list.
ll.JsonGetValue:
deprecated:
message: Use 'lljson.decode' instead. Also, the indices are zero-based.
args:
- type: string
- type: table
must_use: true
description: Gets the value indicated by Specifiers from the JSON string.
ll.JsonSetValue:
deprecated:
message: Use 'lljson.encode' instead. Also, the indices are zero-based.
args:
- type: string
- type: table
Expand All @@ -6884,6 +6890,8 @@ globals:
description: Returns a new JSON string that is the JSON given with the Value indicated
by Specifiers set to Value.
ll.JsonValueType:
deprecated:
message: Use 'lljson.decode' and 'typeof' instead. Also, the indices are zero-based.
args:
- type: string
- type: table
Expand Down Expand Up @@ -7075,6 +7083,10 @@ globals:
in the specified list. If Index describes a location not in the list, or the
value cannot be type-cast to an integer, then zero is returned.
ll.List2Json:
deprecated:
message: Use 'lljson.encode' instead.
replace:
- lljson.encode(%2)
args:
- type: string
- type: table
Expand Down
33 changes: 33 additions & 0 deletions lsl_definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1258,42 +1258,62 @@ constants:
type: integer
value: 0
JSON_APPEND:
slua-deprecated:
reason: Use 'lljson.decode' and 'table.insert' instead.
tooltip: ''
type: integer
value: -1
JSON_ARRAY:
slua-deprecated:
use: lljson.array_mt
tooltip: ''
type: string
value: '\u{FDD2}'
JSON_DELETE:
slua-deprecated:
use: nil
tooltip: ''
type: string
value: '\u{FDD8}'
JSON_FALSE:
slua-deprecated:
use: "false"
tooltip: ''
type: string
value: '\u{FDD7}'
JSON_INVALID:
slua-deprecated:
use: pcall
tooltip: ''
type: string
value: '\u{FDD0}'
JSON_NULL:
slua-deprecated:
use: lljson.null
tooltip: ''
type: string
value: '\u{FDD5}'
JSON_NUMBER:
slua-deprecated:
use: typeof
tooltip: ''
type: string
value: '\u{FDD3}'
JSON_OBJECT:
slua-deprecated:
use: lljson.object_mt
tooltip: ''
type: string
value: '\u{FDD1}'
JSON_STRING:
slua-deprecated:
use: typeof
tooltip: ''
type: string
value: '\u{FDD4}'
JSON_TRUE:
slua-deprecated:
use: "true"
tooltip: ''
type: string
value: '\u{FDD6}'
Expand Down Expand Up @@ -8103,6 +8123,8 @@ functions:
- JSON:
tooltip: ''
type: string
slua-deprecated:
use: lljson.decode
energy: 10.0
func-id: 513
pure: true
Expand All @@ -8120,6 +8142,9 @@ functions:
# But we don't support that in the bindgen yet.
# index-semantics: true
type: list
slua-deprecated:
use: lljson.decode
reason: Also, the indices are zero-based.
energy: 10.0
func-id: 511
pure: true
Expand All @@ -8140,6 +8165,9 @@ functions:
- Value:
tooltip: ''
type: string
slua-deprecated:
use: lljson.encode
reason: Also, the indices are zero-based.
energy: 10.0
func-id: 510
pure: true
Expand All @@ -8158,6 +8186,8 @@ functions:
# But we don't support that in the bindgen yet.
# index-semantics: true
type: list
slua-deprecated:
reason: Use 'lljson.decode' and 'typeof' instead. Also, the indices are zero-based.
energy: 10.0
func-id: 512
pure: true
Expand Down Expand Up @@ -8572,6 +8602,9 @@ functions:
- Values:
tooltip: List of values to convert.
type: list
slua-deprecated:
use: lljson.encode
selene-replace: ["lljson.encode(%2)"]
energy: 10.0
func-id: 514
pure: true
Expand Down
4 changes: 3 additions & 1 deletion lsl_definitions/lsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class LSLConstant(NamedTuple):
"""
tooltip: str
deprecated: Deprecated | None
slua_deprecated: Deprecated | None
private: bool
"""Whether this should this be included in the syntax file"""

Expand Down Expand Up @@ -204,7 +205,7 @@ def to_slua_dict(self, slua: "SLuaDefinitions") -> dict:
try:
return remove_worthless(
{
"deprecated": self.deprecated is not None,
"deprecated": (self.deprecated or self.slua_deprecated) is not None,
# Will always use a <string> node, but that's fine for our purposes.
# That's already the case for vector and hex int constants, anyway.
"tooltip": self.tooltip,
Expand Down Expand Up @@ -648,6 +649,7 @@ def _handle_constant(self, const_name: str, const_data: dict) -> LSLConstant:
tooltip=const_data.get("tooltip", ""),
private=const_data.get("private", False),
deprecated=Deprecated.from_definition(const_data.get("deprecated", False)),
slua_deprecated=Deprecated.from_definition(const_data.get("slua-deprecated", False)),
)
if const.type not in {"float", "integer", "string", "vector", "rotation"}:
raise ValueError(f"Invalid constant type {const.type}")
Expand Down
Loading