soma.cell

E1002: unexpected_eof

E1002 unexpected_eof — the file ends inside a construct.

A compile-time error of soma check, the checker of the Soma programming language (soma explain E1002).

The rule

E1002 is meant for a file that ends inside a construct, but this compiler reports that case under E1001 instead: a missing closing brace at the end of the file gives expected '}', found end of file. An unterminated string or block comment is a lexer error, E1010. The fix in every case is to close the construct that is still open: count the { and } of the last cell and handler.

When you see it

The parser never builds its "unexpected end of input" error (ParseError::UnexpectedEof is declared but not constructed in compiler/src/parser), so soma check never reports E1002. A file that ends inside a construct is reported as E1001, for example expected '}', found end of file; an unterminated string or block comment is E1010.