File: test4f.mod

package info (click to toggle)
m2c 0.6-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,096 kB
  • ctags: 1,907
  • sloc: ansic: 18,088; sh: 168; makefile: 60
file content (28 lines) | stat: -rw-r--r-- 539 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(* p.136 6t-7t *)

(* Declarations and scope rules *)

(* If an identifier defined in a module M1 is exported,          *)
(*   the scope expands over the block which contains M1,         *)
(*   it extends to all those units which import M1.              *)

(* x is not wisible in main module *)

MODULE test4f;
 MODULE LEVEL1;
  MODULE LEVEL2;
   EXPORT x;
   VAR
      x:REAL;
   BEGIN
    x:=1.12;
   END LEVEL2;
  VAR
     y:REAL;
  BEGIN
   y:=2.2;
   x:=0.7;
  END LEVEL1;
 BEGIN
  x:=8.8; (* x is not wisible here *)
 END test4f.