Ticket #741: close_lib.pir

File close_lib.pir, 5.7 KB (added by Austin_Hastings, 13 years ago)

Library needed by try.pir

Line 
1
2.namespace []
3.sub "anon"  :subid("post19")
4.end
5
6
7.HLL "close"
8
9.namespace []
10.sub "_init_namespace_close" :anon :init :load :subid("10_1244173560")
11.annotate "line", 82
12    get_hll_global $P12, "test_counter"
13    unless_null $P12, vivify_20
14    new $P12, "Integer"
15    assign $P12, 0
16    set_hll_global "test_counter", $P12
17  vivify_20:
18.annotate "line", 0
19    .return ($P12)
20.end
21
22
23.HLL "close"
24
25.namespace []
26.sub "load"  :subid("11_1244173560")
27    .param pmc param_14
28.annotate "line", 4
29    .lex "filename", param_14
30.annotate "line", 6
31    find_lex $P15, "filename"
32
33        push_eh failed
34        $S0 = $P15
35        load_bytecode $S0
36        pop_eh
37        .return()
38      failed:
39        die "image not found"
40   
41.annotate "line", 4
42    .return ()
43.end
44
45
46.HLL "close"
47
48.namespace []
49.sub "print"  :subid("12_1244173560")
50    .param pmc param_17 :slurpy
51.annotate "line", 58
52    .lex "args", param_17
53.annotate "line", 60
54    .local pmc list
55    new $P18, "String"
56    assign $P18, "Iterator"
57    find_lex $P19, "args"
58    $P20 = new $P18, $P19
59    set list, $P20
60.annotate "line", 62
61    new $P23, 'ExceptionHandler'
62    set_addr $P23, loop22_handler
63    $P23."handle_types"(65, 67, 66)
64    push_eh $P23
65  loop22_test:
66    unless list, loop22_done
67  loop22_redo:
68.annotate "line", 63
69    $P21 = shift list
70    print $P21
71  loop22_next:
72.annotate "line", 62
73    goto loop22_test
74  loop22_handler:
75    .local pmc exception
76    .get_results (exception)
77    getattribute $P24, exception, 'type'
78    eq $P24, 65, loop22_next
79    eq $P24, 67, loop22_redo
80  loop22_done:
81    pop_eh
82.annotate "line", 58
83    .return (list)
84.end
85
86
87.HLL "close"
88
89.namespace []
90.sub "say"  :subid("13_1244173560")
91    .param pmc param_26 :slurpy
92.annotate "line", 67
93    .lex "args", param_26
94.annotate "line", 69
95    find_lex $P27, "args"
96    new $P28, "String"
97    assign $P28, "\n"
98    push $P27, $P28
99.annotate "line", 70
100    .local pmc list
101    new $P29, "String"
102    assign $P29, "Iterator"
103    find_lex $P30, "args"
104    $P31 = new $P29, $P30
105    set list, $P31
106.annotate "line", 72
107    new $P34, 'ExceptionHandler'
108    set_addr $P34, loop33_handler
109    $P34."handle_types"(65, 67, 66)
110    push_eh $P34
111  loop33_test:
112    unless list, loop33_done
113  loop33_redo:
114.annotate "line", 73
115    $P32 = shift list
116    print $P32
117  loop33_next:
118.annotate "line", 72
119    goto loop33_test
120  loop33_handler:
121    .local pmc exception
122    .get_results (exception)
123    getattribute $P35, exception, 'type'
124    eq $P35, 65, loop33_next
125    eq $P35, 67, loop33_redo
126  loop33_done:
127    pop_eh
128.annotate "line", 67
129    .return (list)
130.end
131
132
133.HLL "close"
134
135.namespace []
136.sub "ok"  :multi(_,_) :subid("14_1244173560")
137    .param pmc param_37
138    .param pmc param_38
139.annotate "line", 84
140    .lex "condition", param_37
141    .lex "test_name", param_38
142.annotate "line", 86
143    find_lex $P40, "condition"
144    if $P40, unless_39_end
145    "print"("not ")
146  unless_39_end:
147.annotate "line", 87
148    get_hll_global $P41, "test_counter"
149    ## inline postfix:++
150    clone $P42, $P41
151    inc $P41
152.annotate "line", 88
153    get_hll_global $P43, "test_counter"
154    "print"("ok ", $P43)
155.annotate "line", 90
156    find_lex $P45, "test_name"
157    unless $P45, if_44_end
158.annotate "line", 91
159    find_lex $P46, "test_name"
160    "print"(" - ", $P46)
161  if_44_end:
162.annotate "line", 94
163    "print"("\n")
164.annotate "line", 95
165    find_lex $P47, "condition"
166    .return ($P47)
167.annotate "line", 84
168    .return ()
169.end
170
171
172.HLL "close"
173
174.namespace []
175.sub "ok"  :multi(_,_,_) :subid("15_1244173560")
176    .param pmc param_49
177    .param pmc param_50
178    .param pmc param_51
179.annotate "line", 98
180    .lex "got", param_49
181    .lex "expected", param_50
182    .lex "test_name", param_51
183.annotate "line", 100
184    .local pmc match
185.annotate "line", 102
186    find_lex $P52, "got"
187    find_lex $P53, "expected"
188        $I0 = iseq $P52, $P53
189        $P54 = new 'Integer'
190        $P54 = $I0
191    set match, $P54
192.annotate "line", 103
193    find_lex $P55, "test_name"
194    "ok"(match, $P55)
195.annotate "line", 105
196    unless match, unless_57
197    goto unless_57_end
198  unless_57:
199.annotate "line", 106
200    find_lex $P58, "expected"
201    find_lex $P59, "got"
202    $P60 = "print"("# Wanted: ", $P58, ", but got: ", $P59, "\n")
203.annotate "line", 105
204    set $P56, $P60
205  unless_57_end:
206.annotate "line", 98
207    .return ($P56)
208.end
209
210
211.HLL "close"
212
213.namespace []
214.sub "plan"  :subid("16_1244173560")
215    .param pmc param_62 :optional
216    .param int has_param_62 :opt_flag
217.annotate "line", 110
218    if has_param_62, optparam_21
219    new $P63, "Integer"
220    assign $P63, 0
221    set param_62, $P63
222  optparam_21:
223    .lex "num_tests", param_62
224.annotate "line", 112
225    find_lex $P66, "num_tests"
226    if $P66, if_65
227.annotate "line", 116
228    $P69 = "print"("no plan\n")
229.annotate "line", 115
230    set $P64, $P69
231.annotate "line", 112
232    goto if_65_end
233  if_65:
234.annotate "line", 113
235    find_lex $P67, "num_tests"
236    $P68 = "print"("1..", $P67, "\n")
237.annotate "line", 112
238    set $P64, $P68
239  if_65_end:
240.annotate "line", 110
241    .return ($P64)
242.end
243
244
245.HLL "close"
246
247.namespace []
248.sub "length"  :subid("17_1244173560")
249    .param pmc param_71
250.annotate "line", 122
251    .lex "s", param_71
252.annotate "line", 124
253    .local pmc len
254.annotate "line", 126
255    find_lex $P72, "s"
256
257        $S0 = $P72
258        $I0 = length $S0
259        $P73 = $I0
260   
261    set len, $P73
262.annotate "line", 132
263    .return (len)
264.annotate "line", 122
265    .return ()
266.end
267
268
269.HLL "close"
270
271.namespace []
272.sub "index"  :subid("18_1244173560")
273    .param pmc param_75
274    .param pmc param_76
275.annotate "line", 135
276    .lex "haystack", param_75
277    .lex "needle", param_76
278.annotate "line", 137
279    find_lex $P77, "haystack"
280    find_lex $P78, "needle"
281
282        $S0 = $P77
283        $S1 = $P78
284        $I0 = index $S0, $S1
285        $P79 = $I0
286   
287    .return ($P79)
288.annotate "line", 135
289    .return ()
290.end
291