Skip to content
Prismio docs
ImplementedPrismio 0.1.0

Unclosed block

Fix a Prismio opening brace that reaches end of file without a matching closing brace.

Last verified

Implemented. Available in the audited Prismio 0.1.0 compiler. Pre-1.0 syntax may still change.

Meaning

A { starts a function, control-flow, match-arm, region, struct, or enum block and no matching } appears before end of file.

One missing brace can make the parser treat later declarations as nested statements and create several follow-up diagnostics.

Why it happens

Nested if, loop, match-arm, and struct literals can make visual pairing difficult, especially after code is moved. Prismio has no semicolon-based recovery boundary to compensate for an open block.

Invalid code

prismio
fn main() -> Int {
    return 0

Correct code

prismio
fn main() -> Int {
    return 0
}

Common fixes

Add the missing closing brace at the correct nesting level. The diagnostic span points to the block's opening brace.

Indent nested blocks consistently and recompile after fixing the first unmatched brace. Do not append a brace blindly at end of file if the intended block should have closed earlier.