hello,
all languages that are similar to c (c++,
Java, JavaScript, ...) allow a semicolon in many places which does not change the semantics of the code. The grammar would look less elegant if it would disallow that. This Java program for example is perfectly valid:
In c for example a statement can consist of a single expression followed by a semicolon, and the expression in that is optional:
Kai