diff --git a/source/parser.d b/source/parser.d index eb07090..487dcfd 100644 --- a/source/parser.d +++ b/source/parser.d @@ -557,6 +557,11 @@ final class StatementParser FunctionBlock parseFunctionBlock (string prevIndent) { + if (t.empty) + { + enforce (!t.empty, "program is empty"); + } + auto line = t.front; check (line.indent == prevIndent, line, "indent does not match");