Why this happens
alt, loop, opt, par, critical, and break all open a block that must be closed with its own end, the same way subgraph does in flowcharts. Forgetting the end -- often after deleting or reordering lines during an edit -- leaves the parser expecting more content that never arrives.
The error appears at the end of the file (or the next sibling block), not at the line that actually opened the unclosed block, which makes it easy to miss on a quick read.
How to fix it
Add the missing end after the block's last message. For nested blocks (an alt inside a loop, for example), count opens and closes -- each one needs its own end, innermost first.