source:
src/Tests/SynTree/Scope.c
@
cd623a4
Last change on this file since cd623a4 was a65d92e, checked in by , 9 years ago | |
---|---|
|
|
File size: 674 bytes |
Rev | Line | |
---|---|---|
[51b7345] | 1 | int x; |
2 | typedef double y; | |
3 | typedef float t; | |
4 | y z; | |
5 | type u = struct { int a; double b; }; | |
6 | int f( int y ); | |
7 | y q; | |
8 | ||
9 | y w(y y, u v) { | |
[a65d92e] | 10 | type x | { x t(u); }; |
11 | u u = y; | |
12 | x z = t(u); | |
[51b7345] | 13 | } |
14 | ||
15 | y p; | |
16 | ||
17 | context has_u( type z ) | |
18 | { | |
[a65d92e] | 19 | z u(z); |
[51b7345] | 20 | }; |
21 | ||
22 | forall( type t | has_u( t ) ) | |
23 | y q( t the_t ) | |
24 | { | |
[a65d92e] | 25 | t y = u( the_t ); |
[51b7345] | 26 | } |
27 | ||
28 | t f( y p ) { | |
[a65d92e] | 29 | int y; |
30 | typedef char x; | |
[51b7345] | 31 | |
[a65d92e] | 32 | { |
33 | x y; | |
34 | typedef x z; | |
[51b7345] | 35 | |
[a65d92e] | 36 | { |
37 | z x; | |
38 | typedef z y; | |
39 | y z = x; | |
40 | } | |
[51b7345] | 41 | |
[a65d92e] | 42 | z x = y; |
43 | } | |
[51b7345] | 44 | |
[a65d92e] | 45 | x q = y; |
[51b7345] | 46 | } |
47 | ||
48 | t g( void ) { | |
[a65d92e] | 49 | typedef char x; |
50 | try { | |
51 | some_func(); | |
52 | } catch ( x x ) { | |
53 | t y = x; | |
54 | } | |
55 | x z; | |
[51b7345] | 56 | } |
57 | ||
[a65d92e] | 58 | y q( i ) |
[51b7345] | 59 | int i; |
60 | { | |
[a65d92e] | 61 | switch ( i ) { |
62 | y q = i; | |
63 | case 0: | |
64 | return q; | |
65 | default: | |
66 | return i; | |
67 | } | |
[51b7345] | 68 | } |
69 | ||
[a65d92e] | 70 | // Local Variables: // |
71 | // tab-width: 4 // | |
72 | // End: // |
Note: See TracBrowser
for help on using the repository browser.