Ticket #681: test.pir

File test.pir, 417 bytes (added by flh, 6 years ago)

Failing example of IO object in PIR

Line 
1.sub main :main
2    $P0 = new 'MyIO'
3    $S0 = read $P0, 3
4    say $S0
5.end
6
7.namespace ['MyIO']
8
9.sub '' :anon :load :init
10    $P1 = newclass 'MyIO'
11.end
12
13.sub 'read' :method
14    .param int bytes
15    .return("foo")
16.end
17
18.sub 'eof' :method
19    .return (0)
20.end
21
22.sub 'get_bool' :method :vtable
23    .return (1)
24.end
25
26# Local Variables:
27#   mode: pir
28#   fill-column: 100
29# End:
30# vim: expandtab shiftwidth=4 ft=pir:
31