Ticket #1550: clone_lex.pir

File clone_lex.pir, 266 bytes (added by fperrad, 4 years ago)
Line 
1.sub 'main' :main
2    .const 'Sub' f = 'func'
3    $P0 = clone f
4    $P0()
5.end
6
7.sub 'func' :lex
8    say "func"
9    $P0 = box 'STATE'
10    .lex 'VAR', $P0
11    inner()
12.end
13
14.sub 'inner' :lex :outer('func')
15    $P0 = find_lex 'VAR'
16    say $P0
17.end
18