Skip to content

String interpolation #147

Open
Open
@kindlich

Description

@kindlich

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bytecodeAll issues that relate to the generation of Java BytecodeenhancementNew feature or requestparserverifier

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions