blob: f750a84a3b695c8b3325013817c5e80cc12fbb12 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
include rt;
include run;
include icon;
typecheck on;
// a rejected publication must leave the previous entry (and any o3 caller of it)
// unchanged: status 6, still returning the last successfully published body.
o3 int target() { return 4; }
o3 int caller() { return target() + target(); }
fn main() {
let four = run.tokens("4"), five = run.tokens("5");
rt.put_n(caller()); rt.put_c(' ');
rt.put_n(icon.find_replace(target, four, five)); rt.put_c(' ');
rt.put_n(caller()); rt.put_c(' ');
let bad_pat = run.tokens("return $int;"), bad_rep = run.tokens("return \"x\";");
rt.put_n(icon.find_replace(target, bad_pat, bad_rep)); rt.put_c(' ');
rt.put_n(icon.error()); rt.put_c(' ');
rt.put_n(caller()); rt.put_c(10);
return 0;
}
|