summaryrefslogtreecommitdiffstats
path: root/tests/007/except-1.txr
blob: 7f205a7f16fb53b6fb6d030f0a90fee81b8a9a6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@(defex u0)
@(defex u1)
@(define baz (x))
@  (cases)
@    (bind x "0")
@    (throw u0 "text0")
@  (or)
@    (bind x "1")
@    (throw u1 "text1")
@  (end)
@(end)
@(define bar (x))
@  (baz x)
@(end)
@(define foo ())
@  (next `!echo "0\n1\n"`)
@  (collect)
@num
@    (try)
@      (bar num)
@    (catch u0 (arg))
@      (output)
caught u0: @arg
@      (end)
@    (catch u1 (arg))
@      (output)
caught u1: @arg
@      (end)
@    (end)
@  (end)
@(end)
@(foo)