t_bad_nestfwd.mod 403 B

12345678910111213141516171819
  1. MODULE TBadNestFwd;
  2. // A nested procedure whose body names a parent local declared *later*
  3. // is no longer tolerated (the forward-variable machinery is gone with
  4. // the two-phase parse): a plain 201. Expects "undeclared identifier".
  5. VAR ExitCode : INTEGER;
  6. PROCEDURE Outer;
  7. PROCEDURE Inner;
  8. BEGIN
  9. x := 5
  10. END Inner;
  11. VAR x : INTEGER;
  12. BEGIN
  13. Inner
  14. END Outer;
  15. BEGIN
  16. Outer
  17. END TBadNestFwd.