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
24 changes: 12 additions & 12 deletions generated/slua_default.d.luau
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,14 @@ declare ll: {
AvatarOnSitTarget: () -> uuid,
Axes2Rot: (Forward: vector, Left: vector, Up: vector) -> quaternion,
AxisAngle2Rot: (Axis: vector, Angle: number) -> quaternion,
Base64ToInteger: (Text: string) -> number,
Base64ToString: (Text: string) -> string,
Base64ToInteger: @[deprecated {reason="Use 'llbase64.decode' and 'string.unpack' or 'buffer.readi32' instead."}](Text: string) -> number,
Base64ToString: @[deprecated {use='llbase64.decode'}](Text: string) -> string,
BreakAllLinks: () -> (),
BreakLink: (LinkNumber: number) -> (),
CSV2List: (Text: string) -> {string},
CastRay: (Start: vector, End: vector, Options: list) -> {any},
Ceil: (Value: number) -> number,
Char: (value: number) -> string,
Char: @[deprecated {reason="Use 'utf8.char' or 'string.char' instead."}](value: number) -> string,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't find an issue with char:

print("Luau Char: " .. utf8.char(1044)) -- Д
print("SL Char: " .. ll.Char(1044)) -- Д

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to do a full spectrum check, as per the caveats I added on the wiki page for llChar

Copy link
Contributor Author

@tapple tapple Mar 13, 2026

Choose a reason for hiding this comment

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

wrote a verification script:

for i = 0, 0x10FFFF do
--for i = 0, 0x10 do
--for i = 0xFFEE, 0x10FFFF do
--for i = 0xD800, 0xFFFF do
    if 0xD800 <= i and i < 0xE000 then
        -- surrogate pairs
        local luau_char = utf8.char(i)
        local utf8_raw = string.char(
            bit32.bor(0xE0, bit32.rshift(i, 12)),
            bit32.bor(0x80, bit32.band(0x3F, bit32.rshift(i, 6))),
            bit32.bor(0x80, bit32.band(0x3F, i))
        )
        assert(luau_char == utf8_raw)--, string.format('utf8.char(0x%x) incorrect', i))
        local luau_ord_valid, luau_ord = pcall(utf8.codepoint, luau_char)
        assert(not luau_ord_valid)--, string.format('"utf8.codepoint("\\u{%x}") did not error', i))
        assert(luau_ord == "invalid UTF-8 code") 
        -- lsl silliness --
        assert(ll.Char(i) == '\u{FFFD}')--, string.format('ll.Char(0x%x) incorrect', i))
        assert(ll.Ord(luau_char, 1) == 0x3F)--, string.format('ll.Ord("\\u{%x}", 1) incorrect', i))
    else
        local lsl_char = ll.Char(i)
        local luau_char = utf8.char(i)
        local lsl_ord = ll.Ord(luau_char, 1)
        local luau_ord = utf8.codepoint(luau_char)
        assert(luau_ord == i)--, string.format('utf8.codepoint("%s") = 0x%x ~= 0x%x', luau_char, luau_ord, i))
        if 0xFFFE <= i and i <= 0xFFFF then -- lsl silliness --
            assert(lsl_char == '\u{FFFD}')--, string.format('ll.Char(0x%x) incorrect', i))
        elseif i == 0 then -- lsl silliness --
            assert(lsl_char == '')--, string.format('ll.Char(0x%x) incorrect', i))
        else
            assert(lsl_char == luau_char)--, string.format('ll.Char(0x%x) = "%s" ~= utf8.char(0x%x) = "%s"', i, lsl_char, i, luau_char))
        end
        if 0xFFFE == i then -- lsl silliness --
            assert(lsl_ord == 0x3F)--, string.format('ll.Ord("\\u{%x}", 1) incorrect', i))
        else
            assert(lsl_ord == i)--, string.format('ll.Ord("%s") = 0x%x ~= 0x%x', luau_char, lsl_ord, i))
        end
    end
end
print("done")

ClearCameraParams: () -> (),
ClearLinkMedia: (Link: number, Face: number) -> number,
ClearPrimMedia: (Face: number) -> number,
Expand All @@ -502,7 +502,7 @@ declare ll: {
DeleteCharacter: () -> (),
DeleteKeyValue: (Key: string) -> uuid,
DeleteSubList: <T>(Source: {T}, Start: number, End: number) -> {T},
DeleteSubString: (Source: string, Start: number, End: number) -> string,
DeleteSubString: @[deprecated {use='string.sub'}](Source: string, Start: number, End: number) -> string,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

takes byte index rather than codepoint index

DerezObject: (ID: uuid, flags: number) -> boolean,
DetachFromAvatar: () -> (),
DetectedDamage: @[deprecated {use='getDamage'}](Number: number) -> {any},
Expand Down Expand Up @@ -662,7 +662,7 @@ declare ll: {
GetStartString: () -> string,
GetStaticPath: (Start: vector, End: vector, Radius: number, Parameters: list) -> {any},
GetStatus: (StatusFlag: number) -> boolean,
GetSubString: (String: string, Start: number, End: number) -> string,
GetSubString: @[deprecated {use='string.sub'}](String: string, Start: number, End: number) -> string,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

takes byte index rather than codepoint index

GetSunDirection: () -> vector,
GetSunRotation: () -> quaternion,
GetTexture: (Face: number) -> string,
Expand Down Expand Up @@ -774,7 +774,7 @@ declare ll: {
OffsetTexture: (OffsetS: number, OffsetT: number, Face: number) -> (),
OpenFloater: (floater_name: string, url: string, params: list) -> number,
OpenRemoteDataChannel: @deprecated () -> (),
Ord: (value: string, index: number) -> number,
Ord: @[deprecated {reason="Use 'utf8.codepoint' or 'string.byte' instead."}](value: string, index: number) -> number,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't find an issue with ord:

print("Luau Ord: " .. utf8.codepoint("Д")) -- 1044
print("SL Ord: " .. ll.Ord("Д", 1)) -- 1044

Copy link
Contributor Author

@tapple tapple Mar 13, 2026

Choose a reason for hiding this comment

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

Takes byte index rather than codepoint index:

print(ll.Ord("ДД", 2)) -- 1044
print(utf8.codepoint("ДД", 2)) -- invalid UTF-8 code
print(utf8.codepoint("ДД", 3)) -- 1044

OverMyLand: (ID: uuid) -> boolean,
OwnerSay: (Text: string) -> (),
ParcelMediaCommandList: (CommandList: list) -> (),
Expand Down Expand Up @@ -807,7 +807,7 @@ declare ll: {
RemoveVehicleFlags: (Vehiclelags: number) -> (),
ReplaceAgentEnvironment: (agent_id: uuid, transition: number, environment: string | uuid) -> number,
ReplaceEnvironment: (position: vector, environment: string | uuid, track_no: number, day_length: number, day_offset: number) -> number,
ReplaceSubString: (InitialString: string, SubString: string, NewSubString: string, Count: number) -> string,
ReplaceSubString: @[deprecated {use='string.gsub'}](InitialString: string, SubString: string, NewSubString: string, Count: number) -> string,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not equivilant if the pattern contains regex characters

RequestAgentData: (AvatarID: uuid, Data: number) -> uuid,
RequestDisplayName: (AvatarID: uuid) -> uuid,
RequestExperiencePermissions: (AgentID: uuid, unused: string) -> (),
Expand Down Expand Up @@ -933,10 +933,10 @@ declare ll: {
StopMoveToTarget: () -> (),
StopObjectAnimation: (Animation: string | uuid) -> (),
StopSound: () -> (),
StringLength: (Text: string) -> number,
StringToBase64: (Text: string) -> string,
StringLength: @[deprecated {reason="Use 'utf8.len' or '#' or 'string.len' instead."}](Text: string) -> number,
StringToBase64: @[deprecated {use='llbase64.encode'}](Text: string) -> string,
StringTrim: (Text: string, TrimType: number) -> string,
SubStringIndex: (Text: string, Sequence: string) -> number?,
SubStringIndex: @[deprecated {use='string.find'}](Text: string, Sequence: string) -> number?,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

returns byte index rather than codepoint index

TakeCamera: @[deprecated {use='ll.SetCameraParams'}](AvatarID: uuid) -> (),
TakeControls: (Controls: number, Accept: boolean | number, PassOn: boolean | number) -> (),
Tan: (Theta: number) -> number,
Expand All @@ -948,8 +948,8 @@ declare ll: {
TeleportAgentGlobalCoords: (AvatarID: uuid, GlobalPosition: vector, RegionPosition: vector, LookAtPoint: vector) -> (),
TeleportAgentHome: (AvatarID: uuid) -> (),
TextBox: (AvatarID: uuid, Text: string, Channel: number) -> (),
ToLower: (Text: string) -> string,
ToUpper: (Text: string) -> string,
ToLower: @[deprecated {use='string.lower'}](Text: string) -> string,
Copy link

@Suzanna-Linn Suzanna-Linn Mar 13, 2026

Choose a reason for hiding this comment

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

ll.ToLower()is useful with accents:

print(string.lower("CAFÉ"))  -- > cafÉ
print(ll.ToLower("CAFÉ"))    -- > café

Copy link
Contributor Author

Choose a reason for hiding this comment

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

print(string.lower("ДдAa")) -- Ддaa
print(ll.ToLower("ДдAa")) -- ддaa

Sounds like maybe string.lower should be deprecated instead

ToUpper: @[deprecated {use='string.upper'}](Text: string) -> string,

Choose a reason for hiding this comment

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

ll.ToUpper()is useful with accents:

print(string.upper("café"))  -- > CAFé
print(ll.ToUpper("café"))    -- > CAFÉ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

print(string.upper("ДдAa")) -- ДдAA
print(ll.ToUpper("ДдAa")) --  ДДAA

sounds like maybe string.upper should be deprecated instead

TransferLindenDollars: (AvatarID: uuid, Amount: number) -> uuid,
TransferOwnership: (AgentID: uuid, Flags: number, Params: list) -> number,
TriggerSound: (Sound: string | uuid, Volume: number) -> (),
Expand Down
24 changes: 24 additions & 0 deletions generated/slua_keywords_pretty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17163,6 +17163,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 All @@ -17186,6 +17188,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 @@ -17333,6 +17337,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 @@ -17876,6 +17882,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 @@ -21439,6 +21447,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 @@ -25155,6 +25165,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 @@ -26177,6 +26189,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 @@ -30041,6 +30055,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 All @@ -30064,6 +30080,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 @@ -30128,6 +30146,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 @@ -30541,6 +30561,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 All @@ -30564,6 +30586,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
52 changes: 52 additions & 0 deletions generated/slua_selene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5344,13 +5344,21 @@ globals:
must_use: true
description: Returns the rotation that is a generated Angle about Axis.
ll.Base64ToInteger:
deprecated:
message: Use 'llbase64.decode' and 'string.unpack' or 'buffer.readi32' instead.
replace:
- string.unpack(">i", llbase64.decode(s))
args:
- type: string
must_use: true
description: Returns an integer that is the Text, Base64 decoded as a big endian
integer.\nReturns zero if Text is longer then 8 characters. If Text contains
fewer then 6 characters, the return value is unpredictable.
ll.Base64ToString:
deprecated:
message: Use 'llbase64.decode' instead.
replace:
- llbase64.decode(%1)
args:
- type: string
must_use: true
Expand Down Expand Up @@ -5390,6 +5398,11 @@ globals:
must_use: true
description: Returns smallest integer value >= Value.
ll.Char:
deprecated:
message: Use 'utf8.char' or 'string.char' instead.
replace:
- utf8.char(%1)
- string.char(%1)
args:
- type: number
must_use: true
Expand Down Expand Up @@ -5534,6 +5547,10 @@ globals:
list.\nIf Start is larger than End the list deleted is the exclusion of the
entries; so 6, 4 would delete the entire list except for the 5th list entry.
ll.DeleteSubString:
deprecated:
message: Use 'string.sub' instead.
replace:
- '%1:sub(1, %2-1) .. %1:sub(%3+1, -1)'
args:
- type: string
- type: number
Expand Down Expand Up @@ -6633,6 +6650,10 @@ globals:
description: Returns boolean value of the specified status (e.g. STATUS_PHANTOM)
of the object the script is attached to.
ll.GetSubString:
deprecated:
message: Use 'string.sub' instead.
replace:
- '%1:sub(%2, %3)'
args:
- type: string
- type: number
Expand Down Expand Up @@ -7522,6 +7543,11 @@ globals:
args: []
description: This function is deprecated.
ll.Ord:
deprecated:
message: Use 'utf8.codepoint' or 'string.byte' instead.
replace:
- utf8.codepoint(%...)
- string.byte(%...)
args:
- type: string
- type: number
Expand Down Expand Up @@ -7772,6 +7798,10 @@ globals:
- type: number
description: Replaces the environment for a parcel or region.
ll.ReplaceSubString:
deprecated:
message: Use 'string.gsub' instead.
replace:
- '%1:gsub(%2)'
args:
- type: string
- type: string
Expand Down Expand Up @@ -8697,12 +8727,22 @@ globals:
args: []
description: Stops playback of the currently attached sound.
ll.StringLength:
deprecated:
message: Use 'utf8.len' or '#' or 'string.len' instead.
replace:
- utf8.len(%1)
- '#%1'
- string.len(%1)
args:
- type: string
must_use: true
description: Returns an integer that is the number of characters in Text (not
counting the null).
ll.StringToBase64:
deprecated:
message: Use 'llbase64.encode' instead.
replace:
- llbase64.encode(%1)
args:
- type: string
must_use: true
Expand All @@ -8717,6 +8757,10 @@ globals:
trim all leading spaces in Text\nSTRING_TRIM_TAIL: trim all trailing spaces
in Text\nSTRING_TRIM: trim all leading and trailing spaces in Text.'
ll.SubStringIndex:
deprecated:
message: Use 'string.find' instead.
replace:
- '%1:find(%2)'
args:
- type: string
- type: string
Expand Down Expand Up @@ -8816,11 +8860,19 @@ globals:
contains a text box for input. Any text that is entered is said on the specified
Channel (as if by the avatar) when the "OK" button is clicked.
ll.ToLower:
deprecated:
message: Use 'string.lower' instead.
replace:
- '%1:lower()'
args:
- type: string
must_use: true
description: Returns a string that is Text with all lower-case characters.
ll.ToUpper:
deprecated:
message: Use 'string.upper' instead.
replace:
- '%1:upper()'
args:
- type: string
must_use: true
Expand Down
Loading
Loading