Russell Whitaker wrote:
suggestion for a solution: after the "end." then skip comments, if any then if the next word is not program | module | unit: terminate reading.
Emil's example would not be caught this way.
An additional complication would be that BP allows omitting the `program' header, so the first token of a BP program can actually be many things.
Frank