MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / AppendMap

Method AppendMap

testutil/expr_printer.cc:180–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 void AppendMap(const MapExpr& obj) {
181 if (obj.entries().empty()) {
182 Append("{}");
183 return;
184 }
185 Append("{");
186 AppendLine();
187 Indent();
188 for (int i = 0; i < obj.entries().size(); ++i) {
189 const auto& entry = obj.entries()[i];
190 if (i > 0) {
191 Append(",");
192 AppendLine();
193 }
194 if (entry.optional()) {
195 Append("?");
196 }
197 AppendExpr(entry.key());
198 Append(":");
199 AppendExpr(entry.value());
200 Append(adorner_.AdornMapEntry(entry));
201 }
202 AppendLine();
203 Unindent();
204 Append("}");
205 }
206
207 void AppendComprehension(const ComprehensionExpr& comprehension) {
208 Append("__comprehension__(");

Callers

nothing calls this directly

Calls 6

keyMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
optionalMethod · 0.45
valueMethod · 0.45
AdornMapEntryMethod · 0.45

Tested by

no test coverage detected