Lyricdev
GitHub

LYR-PAR0014

an interpolation not closed by '}'

error · spec 08-expressions

In an f-string, the expression of an interpolation {…} is followed by something else than its } or its format spec :…} — a second expression, a stray ), or the end of the line.

Explanation

An interpolation holds one expression, then optionally : and a format spec, then }. Two expressions side by side, or a bracket the expression did not open, leave the } unreachable; the rest of the line is then misread as well, and more errors follow.

Write one expression in the braces, and close them.

Example

$ cat src/main.lyr
fn main(): void {
    let n = 1;
    let s = f"{n m}";
}
$ lyric build
error[LYR-PAR0014]: expected '}' to close interpolation
error[LYR-PAR0016]: expected ';'
error[LYR-PAR0002]: expected an expression, got FStringInterpEnd
error[LYR-PAR0016]: expected ';'
error[LYR-PAR0002]: expected an expression, got FStringEnd
error[LYR-PAR0016]: expected ';'