ParseError thrown

syntax error, unexpected token "endwhile", expecting end of file