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

String interpolation #147

Open
8 tasks
kindlich opened this issue Jun 2, 2024 · 0 comments
Open
8 tasks

String interpolation #147

kindlich opened this issue Jun 2, 2024 · 0 comments
Labels
bytecode All issues that relate to the generation of Java Bytecode enhancement New feature or request parser verifier
Milestone

Comments

@kindlich
Copy link
Member

kindlich commented Jun 2, 2024

Some other programming languages (Groovy, JavaScript, Kotlin, ...) allow for string interpolation.
Check if we can/want to allow this as well.

String interpolation: $"xxx{variable}" is an interpolated string and can contain variables. Expressions are not (yet) supported and will be evaluated later. It is possible to escape the { and }. Escaping } is not necessary but permitted: $"This is literally a { and }"
It is not permitted to use an interpolated string as member name (x.$"something" is not allowed) since member names must be constants.

Acceptance criteria:

  • Add String Interpolation feature
  • Decide: Should this work for ..?
    • Single-Quoted Strings
    • Double-Quoted Strings
    • WYSIWYG-Strings (single or double quoted)
  • Add test that checks the feature
    • Green path
    • Test(s) that test escaping the {} characters (or whichever chars are used to refer to variables.
    • reference a non-existing variable
    • invoke more complex logic inside the interpolation
    • have an interpolation expression that does not return a string (should that attempt an implicit/explicit cast to string or fail?)
@kindlich kindlich added enhancement New feature or request bytecode All issues that relate to the generation of Java Bytecode verifier parser labels Jun 2, 2024
@kindlich kindlich added this to the v2.0.0 milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bytecode All issues that relate to the generation of Java Bytecode enhancement New feature or request parser verifier
Projects
None yet
Development

No branches or pull requests

1 participant