MCPcopy Create free account
hub / github.com/build2/build2 / json_array_append

Function json_array_append

libbuild2/variable.cxx:2300–2322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2298 }
2299
2300 static void
2301 json_array_append (value& v, names&& ns, const variable* var)
2302 {
2303 using val_traits = value_traits<json_value>;
2304 using arr_traits = value_traits<json_array>;
2305
2306 try
2307 {
2308 arr_traits::append (v, val_traits::convert (move (ns)));
2309 }
2310 catch (const invalid_argument& e)
2311 {
2312 // Note: ns is not guaranteed to be valid.
2313 //
2314 diag_record dr (fail);
2315 dr << "invalid json array";
2316
2317 if (var != nullptr)
2318 dr << " in variable " << var->name;
2319
2320 dr << ": " << e;
2321 }
2322 }
2323
2324 static void
2325 json_array_prepend (value& v, names&& ns, const variable* var)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected