Experimenting with the syntax, I discovered that adjacent template string literals are implicitly concatenated:
ucode -Sp '`foo``bar` === "foobar"'
true
Whitespaces between literals are ignored:
ucode -Sp '`foo`
`bar` `baz`'
foobarbaz
This only works with template strings, not single- or double-quoted strings or a mix of the former and the latter.
This doesn't seem to be a part of the ECMAScript syntax (at least this doesn't work with V8 and SpiderMonkey), which ucode is inspired by, and is not documented in the ucode documentation.
I'd like to use this as a feature (see below), but not sure if this is actually a stable feature and not a quirk.
const command = (
`long`
` string`
` literal`
)
ucode version I use: v0.0.20250529
Experimenting with the syntax, I discovered that adjacent template string literals are implicitly concatenated:
Whitespaces between literals are ignored:
This only works with template strings, not single- or double-quoted strings or a mix of the former and the latter.
This doesn't seem to be a part of the ECMAScript syntax (at least this doesn't work with V8 and SpiderMonkey), which ucode is inspired by, and is not documented in the ucode documentation.
I'd like to use this as a feature (see below), but not sure if this is actually a stable feature and not a quirk.
ucode version I use: v0.0.20250529