b_mix.mod 464 B

1234567891011121314151617181920212223
  1. MODULE BMix;
  2. (* Init body in an earlier module + procedure-owning module with its
  3. own init later: the early init must not steal the procedure's
  4. proc-table slot (regression: A.x read 0, C.cnt read 15). *)
  5. MODULE A EXPORT x;
  6. VAR x : INTEGER;
  7. BEGIN
  8. x := 1
  9. END A;
  10. MODULE C EXPORT cnt, Inc;
  11. VAR cnt : INTEGER;
  12. PROCEDURE Inc;
  13. BEGIN
  14. cnt := cnt + 5
  15. END Inc;
  16. BEGIN
  17. Inc();
  18. C.Inc()
  19. END C;
  20. VAR ExitCode : INTEGER;
  21. BEGIN
  22. ExitCode := A.x * 100 + C.cnt
  23. END BMix.