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

Function json_array_prepend

libbuild2/variable.cxx:2324–2346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2322 }
2323
2324 static void
2325 json_array_prepend (value& v, names&& ns, const variable* var)
2326 {
2327 using val_traits = value_traits<json_value>;
2328 using arr_traits = value_traits<json_array>;
2329
2330 try
2331 {
2332 arr_traits::prepend (v, val_traits::convert (move (ns)));
2333 }
2334 catch (const invalid_argument& e)
2335 {
2336 // Note: ns is not guaranteed to be valid.
2337 //
2338 diag_record dr (fail);
2339 dr << "invalid json array";
2340
2341 if (var != nullptr)
2342 dr << " in variable " << var->name;
2343
2344 dr << ": " << e;
2345 }
2346 }
2347
2348 const json_array value_traits<json_array>::empty_instance;
2349 const char* const value_traits<json_array>::type_name = "json_array";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected