summaryrefslogtreecommitdiffstats
path: root/tests/010/span-var.txr
blob: 036acc6a9b4b04a4c710e6f25fd2e8eb5a272a9d (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
33
34
35
36
37
38
39
@(define fun (x y))
@(bind x "x")
@y
@y
@y
@(end)
@(next :list '("a" "a" "a" "b" "c"))
@{z (fun x "a")}
@(require (equal x "x"))
@(require (equal z '("a" "a" "a")))
@(define fun2 (x y))@(bind x "x")@y@(end)
@(next :string "ab")
@{w (fun2 x "a")}@y
@(require (equal w "a"))
@(require (equal y "b"))
@(next :list '("a" "a" "a" "b" "c"))
@(bind d ("d"))
@(cases)
@  {d (fun "x" "a")}
@  {require (not "get here")}
@(or)
@  (require "get here")
@(end)
@(next :string "ab")
@(cases)
@  {d (fun2 "x" "a")}
@  {require (not "get here")}
@(or)
@  (require "get here")
@(end)
@(bind n "123")
@(next :string "123456")
@(cases)
@  {n /\d+/}
@  {require (not "get here")}
@(or)
@  {m /\d+/}
@  (require (equal m "123456"))
@(end)