Skip to content

Decide whether there should be syntax for literal string concatenation #55

Description

@robertmuth

In C adjacent strings are automatically concatenated.

So printf("hello " "world!") is the same as printf("hello world!")

In Cwerg we do not have this yet.

Example where it would be useful:

let complex_escape_sequence = "\x1b[" "34" ";" "2" "m"

It would be even nicer if this also worked for global constant strings/arrays, e.g.:

let complex_escape_sequence = fmt\SGR_START fmt\SGR_ FG_BLUR ";" fmt\SGR_DIM fmt\SGR_END

this will not parse and we probably need to intruduce an operator, e.g.

let complex_escape_sequence = fmt\SGR_START + fmt\SGR_ FG_BLUR + ";" + fmt\SGR_DIM + fmt\SGR_END

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions