Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wide String Constants Prefix #1965

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

NotsoanoNimus
Copy link

@NotsoanoNimus NotsoanoNimus commented Feb 13, 2025

Adds wide-string constants to the language, e.g. char[?] my_string = L"Each character is 16 bytes wide! Escapes\t are understood!";

This is an analog to an existing (albeit obscure) C feature, which I referenced in my open issue: #1947

I did my best here to conform to code styling/requirements, but please feel free to clean things up or stress-test them.

@lerno I know you said you were going to make a builtin, but I wanted to try my hand at modifying the compiler and writing a test. Go easy on me. If you don't want this feature in the language, I understand, but this was great to get my hands into the compiler anyway!

@NotsoanoNimus
Copy link
Author

NotsoanoNimus commented Feb 13, 2025

One additional comment: I am aware that this is really only a 16-bit conversion abstraction for 8-bit characters right now (char into ushort). At the moment I’m not really sure how this would behave with Unicode or UTF-8, etc etc.

I would certainly be willing to help make the conversion for strings better and more friendly for those use-cases, preferably with some help from someone with a bit more knowledge about that.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant