{$mode ISO} accepts Extended Pascal block as a block
Original Reporter info from Mantis: kays @KaiBurghardt
-
Reporter name: Kai Burghardt
Original Reporter info from Mantis: kays @KaiBurghardt
- Reporter name: Kai Burghardt
Description:
In ISO 7185 a block consist of
- exactly one optional label-section,
- exactly one optional const-section,
- exactly one optional type-section,
- exactly one optional var-section
- optionally routine declarations and definitions
- exactly one compound statement
in that order. Confer http://pascal-central.com/iso7185.html#6.2.1%20Blocks
Steps to reproduce:
However, the following program is accepted, but should fail to compile, because it is out of order:
{$mode ISO}
program blocks(input, output);
procedure foo;
begin
writeLn('Hi!');
end;
var
x: integer;
type
r = record end;
const
answer = 42;
begin
end.
Additional information:
In Extended Pascal, ISO 10206, this restriction is lifted. There, in EP, can be as many sections and routine declaration/definitions parts as necessary, and they can occur in any order, as long as there is one compound statement at the end.
Mantis conversion info:
- Mantis ID: 37739
- OS: GNU/Linux
- OS Build: 4.2.0
- Build: 3.2.0+dfsg-7 [2020/08/21]
- Platform: x86_64
- Version: 3.2.0
- Fixed in version: 3.3.1