-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathtwoVarComprehensions.baseline
More file actions
126 lines (126 loc) · 2.75 KB
/
twoVarComprehensions.baseline
File metadata and controls
126 lines (126 loc) · 2.75 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Source: x.map_string_string.all(i, v, i < v) && x.repeated_int64.all(i, v, i < v) && [1, 2, 3, 4].all(i, v, i < 5 && v > 0) && {'a': 1, 'b': 2}.all(k, v, k.startsWith('a') && v == 1)
declare x {
value cel.expr.conformance.proto3.TestAllTypes
}
=====>
_&&_(
_&&_(
__comprehension__(
// Variable
i,
v,
// Target
x~cel.expr.conformance.proto3.TestAllTypes^x.map_string_string~map(string, string),
// Accumulator
@result,
// Init
true~bool,
// LoopCondition
@not_strictly_false(
@result~bool^@result
)~bool^not_strictly_false,
// LoopStep
_&&_(
@result~bool^@result,
_<_(
i~string^i,
v~string^v
)~bool^less_string
)~bool^logical_and,
// Result
@result~bool^@result)~bool,
__comprehension__(
// Variable
i,
v,
// Target
x~cel.expr.conformance.proto3.TestAllTypes^x.repeated_int64~list(int),
// Accumulator
@result,
// Init
true~bool,
// LoopCondition
@not_strictly_false(
@result~bool^@result
)~bool^not_strictly_false,
// LoopStep
_&&_(
@result~bool^@result,
_<_(
i~int^i,
v~int^v
)~bool^less_int64
)~bool^logical_and,
// Result
@result~bool^@result)~bool
)~bool^logical_and,
_&&_(
__comprehension__(
// Variable
i,
v,
// Target
[
1~int,
2~int,
3~int,
4~int
]~list(int),
// Accumulator
@result,
// Init
true~bool,
// LoopCondition
@not_strictly_false(
@result~bool^@result
)~bool^not_strictly_false,
// LoopStep
_&&_(
@result~bool^@result,
_&&_(
_<_(
i~int^i,
5~int
)~bool^less_int64,
_>_(
v~int^v,
0~int
)~bool^greater_int64
)~bool^logical_and
)~bool^logical_and,
// Result
@result~bool^@result)~bool,
__comprehension__(
// Variable
k,
v,
// Target
{
"a"~string:1~int,
"b"~string:2~int
}~map(string, int),
// Accumulator
@result,
// Init
true~bool,
// LoopCondition
@not_strictly_false(
@result~bool^@result
)~bool^not_strictly_false,
// LoopStep
_&&_(
@result~bool^@result,
_&&_(
k~string^k.startsWith(
"a"~string
)~bool^starts_with_string,
_==_(
v~int^v,
1~int
)~bool^equals
)~bool^logical_and
)~bool^logical_and,
// Result
@result~bool^@result)~bool
)~bool^logical_and
)~bool^logical_and