* Explain a property that takes the form of a list of unlabeled items within * another list. "data" is a list of C strings. */
| 5435 | * another list. "data" is a list of C strings. |
| 5436 | */ |
| 5437 | void |
| 5438 | ExplainPropertyListNested(const char *qlabel, List *data, ExplainState *es) |
| 5439 | { |
| 5440 | ListCell *lc; |
| 5441 | bool first = true; |
| 5442 | |
| 5443 | switch (es->format) |
| 5444 | { |
| 5445 | case EXPLAIN_FORMAT_TEXT: |
| 5446 | case EXPLAIN_FORMAT_XML: |
| 5447 | ExplainPropertyList(qlabel, data, es); |
| 5448 | return; |
| 5449 | |
| 5450 | case EXPLAIN_FORMAT_JSON: |
| 5451 | ExplainJSONLineEnding(es); |
| 5452 | appendStringInfoSpaces(es->str, es->indent * 2); |
| 5453 | appendStringInfoChar(es->str, '['); |
| 5454 | foreach(lc, data) |
| 5455 | { |
| 5456 | if (!first) |
| 5457 | appendStringInfoString(es->str, ", "); |
| 5458 | escape_json(es->str, (const char *) lfirst(lc)); |
| 5459 | first = false; |
| 5460 | } |
| 5461 | appendStringInfoChar(es->str, ']'); |
| 5462 | break; |
| 5463 | |
| 5464 | case EXPLAIN_FORMAT_YAML: |
| 5465 | ExplainYAMLLineStarting(es); |
| 5466 | appendStringInfoString(es->str, "- ["); |
| 5467 | foreach(lc, data) |
| 5468 | { |
| 5469 | if (!first) |
| 5470 | appendStringInfoString(es->str, ", "); |
| 5471 | escape_yaml(es->str, (const char *) lfirst(lc)); |
| 5472 | first = false; |
| 5473 | } |
| 5474 | appendStringInfoChar(es->str, ']'); |
| 5475 | break; |
| 5476 | } |
| 5477 | } |
| 5478 | |
| 5479 | /* |
| 5480 | * Explain a simple property. |
no test coverage detected