For single-line compound statements, "end" should be put at the end of the line:
In order to parse this correctly, we need more info from lexical analysis. Note that checking lineno is not enough to tell if it is a single-line statement due to logical lines. For example: