File: matchn.txtar

package info (click to toggle)
golang-github-cue-lang-cue 0.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,644 kB
  • sloc: makefile: 20; sh: 15
file content (74 lines) | stat: -rw-r--r-- 1,218 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-- in.cue --
import "list"

t1: {
	[=~"^l"]: [1, 2, 3, "str", [1], { foo: 1 }]

	l1: list.MatchN(1, string)
	l2: list.MatchN(3, number)
	l3: list.MatchN(>=1, number)
	l4: list.MatchN(1, [int])
	l5: list.MatchN(1, {foo: int})
	l6: list.MatchN(1, 1)
	l7: list.MatchN(1, "str")
	l8: list.MatchN(>0, "str")
	l9: list.MatchN(1, {foo: 1})
	l10: list.MatchN(0, #TOO)
	l11: list.MatchN(0, [string])
	l12: list.MatchN(3, int | *1)
	l13: list.MatchN(2, 2 | *1)
	l14: list.MatchN(1 | 2, 2 | *1)

	c1: ["xx", 1, 2, 3] | [1]
	c1: list.MatchN(>=2, 1 | *2)
}
#TOO: {too: int}
-- out/list --
t1: {
	l1: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l2: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l3: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l4: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l5: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l6: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l7: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l8: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l9: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l10: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l11: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l12: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l13: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	l14: [1, 2, 3, "str", [1], {
		foo: 1
	}]
	c1: ["xx", 1, 2, 3]
}
#TOO: {
	too: int
}