b_mix.LST 651 B

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