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

Different types of string literals #15

Open
kiedtl opened this issue Sep 11, 2024 · 3 comments
Open

Different types of string literals #15

kiedtl opened this issue Sep 11, 2024 · 3 comments
Labels
lang-new New language feature proposal

Comments

@kiedtl
Copy link
Owner

kiedtl commented Sep 11, 2024

  • Non-NUL terminated strings.
  • Pascal strings.
  • UTF-16 strings (limited or no usefulness?)

Possible syntaxes:

  • (raw "lit") for non-nul-terminated, (pascal "lit") for pascal strings.
  • #r "lit", #p "lit".

I'd prefer the metadata one, because that's really what metadata is for, but it'll require the parser code to undergo some refactoring to be able to handle metadata preceding a value.

Usecase: Strings in mixed static data. See projects/astar.finw -- the MAP static is defined as [[U8 51] 30] due to the null terminators, when it's really only a [[U8 50] 30].

@kiedtl kiedtl added the lang-new New language feature proposal label Sep 11, 2024
@kiedtl
Copy link
Owner Author

kiedtl commented Sep 12, 2024

projects/astar.finw is broken because of this

@kiedtl
Copy link
Owner Author

kiedtl commented Sep 12, 2024

And projects/base64.finw. Alas.

@kiedtl
Copy link
Owner Author

kiedtl commented Sep 14, 2024

Note to self: yet another reason for Pascal strings: strequ would be faster, since if the lengths differ it'd be caught immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-new New language feature proposal
Projects
None yet
Development

No branches or pull requests

1 participant