Skip to content

Conversation

@Sorrowfulwinds
Copy link
Contributor

@Sorrowfulwinds Sorrowfulwinds commented Dec 14, 2025

Adds support for 8 *_char() procs from #2194

It looks like the OpenDream project has settled on text manipulation procs indexing by character and not the byond-default byte indexing. This means that they all function identically to the *_char versions in byond. So these added functions are just wrappers for their non_char versions.

Adds the following proc support:
findtext_char
findtextEx_char
findlasttext_char
findlasttextEx_char
replacetext_char
replacetextEx_char
nonspantext_char
splittext_char

I did a simple test to confirm these share the same results in both this PR of OD and 516.1673 of byond. There is no actual new logic added with this PR so the test is purely for functionality confirmation.

Opendream defaults to text manipulation using UTF-16 char counts. In byond only *_char functions do this. Therefor these are all just wrappers for the existing non_char procs.
Adds proc support for:
findtext_char
findtextEx_char
findlasttext_char
findlasttextEx_char
replacetext_char
replacetextEx_char
nonspantext_char
splittext_char
@boring-cyborg boring-cyborg bot added the Runtime Involves the OpenDream server/runtime label Dec 14, 2025
@Sorrowfulwinds Sorrowfulwinds changed the title Add several *_char function wrappers Implement several *_char function wrappers Dec 14, 2025
Boilerplate stuff so the compiler actually uses the procs
Touchup proc/splittext() in _Standard.dm it was missing vars.
@boring-cyborg boring-cyborg bot added the Compiler Involves the OpenDream compiler label Dec 15, 2025
@github-actions github-actions bot added size/L and removed size/M labels Dec 15, 2025
@Sorrowfulwinds Sorrowfulwinds marked this pull request as ready for review December 15, 2025 00:50
@Sorrowfulwinds
Copy link
Contributor Author

I think I have added the new functions to all the necessary lists. I removed the compiler warnings for these functions and they do compile and return the correct values on a simple test.

@wixoaGit wixoaGit merged commit a2e4945 into OpenDreamProject:master Dec 17, 2025
20 checks passed
@Sorrowfulwinds Sorrowfulwinds deleted the add-text-procs branch December 19, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants