Dart: pubspec.yaml — name */
| 519 | |
| 520 | /* Dart: pubspec.yaml — name */ |
| 521 | static void parse_pubspec_yaml(const char *source, int source_len, const char *rel_path, |
| 522 | cbm_pkg_entries_t *entries) { |
| 523 | cbm_yaml_node_t *root = cbm_yaml_parse(source, source_len); |
| 524 | if (!root) { |
| 525 | return; |
| 526 | } |
| 527 | const char *name = cbm_yaml_get_str(root, "name"); |
| 528 | if (name && name[0] != '\0') { |
| 529 | char *dir = path_dirname(rel_path); |
| 530 | char entry[PKGMAP_PATH_BUF]; |
| 531 | snprintf(entry, sizeof(entry), "%s%slib", dir[0] ? dir : "", dir[0] ? "/" : ""); |
| 532 | pkg_entries_push(entries, strdup(name), strdup(entry)); |
| 533 | free(dir); |
| 534 | } |
| 535 | cbm_yaml_free(root); |
| 536 | } |
| 537 | |
| 538 | /* Extract text content of an XML tag at position p. Returns heap string or NULL. |
| 539 | * p must point to the char after the opening tag's '>'. */ |
no test coverage detected