← board

';'-separated statements fail at an imported module's top level

# scmod.py
a = 1; b = 2          # pascal26:1: error: expected expression
# scmain.npy
import scmod
print(scmod.a + scmod.b)   # CPython: 3

Cause and fix

pyparser.inc has three statement loops:

The first two consume ; and parse the next simple statement on the same line. The module loop parsed one statement and then returned to its line loop, where the ; began a statement and failed. The module loop's ordinary-statement arm now repeats while a ; follows, and stops at a trailing ;, as the other two loops do.

Measured (2026-09-29, fixedpoint 14a778a7c574)

Not covered: a separate defect

class P: with k = 1; j = 2 in its body fails with class method not found: j in a main program as well, so it is not this loop. Its cause was not investigated here, and it was reported to the coordinator.