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
}
|