Skip to content
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
87 changes: 64 additions & 23 deletions data/dev/sl-lua-defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
"name": "numeric",
"definition": {
"kind": "union",
"types": [
"boolean",
"number"
]
"types": ["boolean", "number"]
}
},
{
Expand Down Expand Up @@ -39,24 +36,21 @@
"name": "DetectedEventName",
"definition": {
"kind": "literal-union",
"values": [ ]
"values": []
}
},
{
"name": "NonDetectedEventName",
"definition": {
"kind": "literal-union",
"values": [ ]
"values": []
}
},
{
"name": "EventName",
"definition": {
"kind": "union",
"types": [
"DetectedEventName",
"NonDetectedEventName"
]
"types": ["DetectedEventName", "NonDetectedEventName"]
}
},
{
Expand Down Expand Up @@ -574,7 +568,7 @@
"type": "boolean"
}
],
"methods": [ ]
"methods": []
}
],
"globalVariables": [
Expand Down Expand Up @@ -611,10 +605,7 @@
],
"returnType": {
"kind": "union",
"types": [
"quaternion",
"nil"
]
"types": ["quaternion", "nil"]
},
"comment": "Creates a quaternion from a string argument in format `<1,1,1,1>` Invalid strings will return `nil` #### Caveat Due to an old error from lsl strings that match upto the closing `>` are interpreted as valid So `<1,1,1,1` and `<1,1,1,1spoon` are both cast to `<1,1,1,1>` When testing if a string is a quaternion or a vector, you should test with `toquaternion` first."
},
Expand All @@ -628,10 +619,7 @@
],
"returnType": {
"kind": "union",
"types": [
"vector",
"nil"
]
"types": ["vector", "nil"]
},
"comment": "Creates a vector from a string argument in format `<1,1,1>` Invalid strings will return `nil` #### Caveat Due to an old error from lsl strings that match upto the closing `>` are interpreted as valid So `<1,1,1`, `<1,1,1,1` and `<1,1,1spoon` are all cast to `<1,1,1>` When testing if a string is a quaternion or a vector, you should test with `toquaternion` first."
},
Expand Down Expand Up @@ -962,6 +950,62 @@
],
"returnType": "string",
"comment": "encode lua value as json"
},
{
"comment": "decode json string to lua value preserving types",
"name": "sldecode",
"parameters": [
{
"name": "json",
"type": "string"
}
],
"returnType": {
"kind": "union",
"types": [
"string",
"number",
"vector",
"uuid",
"quaternion",
"boolean",
{
"elementType": "",
"kind": "array"
},
"nil"
]
}
},
{
"comment": "encode lua value as json preserving types. use tight to encode more compactly",
"name": "slencode",
"parameters": [
{
"name": "value",
"type": {
"kind": "union",
"types": [
"string",
"number",
"vector",
"uuid",
"quaternion",
"boolean",
{
"elementType": "",
"kind": "array"
},
"nil"
]
}
},
{
"name": "tight",
"type": "boolean"
}
],
"returnType": "string"
}
]
},
Expand Down Expand Up @@ -1016,10 +1060,7 @@
"name": "value",
"type": {
"kind": "union",
"types": [
"string",
"buffer"
]
"types": ["string", "buffer"]
}
}
],
Expand Down
86 changes: 62 additions & 24 deletions data/syntax_def_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -15428,10 +15428,7 @@
],
"returnType": {
"kind": "union",
"types": [
"quaternion",
"nil"
]
"types": ["quaternion", "nil"]
}
},
{
Expand All @@ -15445,10 +15442,7 @@
],
"returnType": {
"kind": "union",
"types": [
"vector",
"nil"
]
"types": ["vector", "nil"]
}
},
{
Expand Down Expand Up @@ -15808,6 +15802,62 @@
}
],
"returnType": "string"
},
{
"comment": "decode json string to lua value preserving types",
"name": "sldecode",
"parameters": [
{
"name": "json",
"type": "string"
}
],
"returnType": {
"kind": "union",
"types": [
"string",
"number",
"vector",
"uuid",
"quaternion",
"boolean",
{
"elementType": "",
"kind": "array"
},
"nil"
]
}
},
{
"comment": "encode lua value as json preserving types. use tight to encode more compactly",
"name": "slencode",
"parameters": [
{
"name": "value",
"type": {
"kind": "union",
"types": [
"string",
"number",
"vector",
"uuid",
"quaternion",
"boolean",
{
"elementType": "",
"kind": "array"
},
"nil"
]
}
},
{
"name": "tight",
"type": "boolean"
}
],
"returnType": "string"
}
],
"name": "lljson",
Expand Down Expand Up @@ -15901,10 +15951,7 @@
"name": "value",
"type": {
"kind": "union",
"types": [
"string",
"buffer"
]
"types": ["string", "buffer"]
}
}
],
Expand Down Expand Up @@ -16110,20 +16157,14 @@
{
"definition": {
"kind": "union",
"types": [
"boolean",
"number"
]
"types": ["boolean", "number"]
},
"name": "numeric"
},
{
"definition": {
"kind": "union",
"types": [
"string",
"uuid"
]
"types": ["string", "uuid"]
},
"name": "uuid_like"
},
Expand Down Expand Up @@ -16168,10 +16209,7 @@
{
"definition": {
"kind": "union",
"types": [
"DetectedEventName",
"NonDetectedEventName"
]
"types": ["DetectedEventName", "NonDetectedEventName"]
},
"name": "EventName"
},
Expand Down