Dart: pubspec.yaml — name */
| 501 | |
| 502 | /* Dart: pubspec.yaml — name */ |
| 503 | static void parse_pubspec_yaml(const char *source, int source_len, const char *rel_path, |
| 504 | cbm_pkg_entries_t *entries) { |
| 505 | cbm_yaml_node_t *root = cbm_yaml_parse(source, source_len); |
| 506 | if (!root) { |
| 507 | return; |
| 508 | } |
| 509 | const char *name = cbm_yaml_get_str(root, "name"); |
| 510 | if (name && name[0] != '\0') { |
| 511 | char *dir = path_dirname(rel_path); |
| 512 | char entry[PKGMAP_PATH_BUF]; |
| 513 | snprintf(entry, sizeof(entry), "%s%slib", dir[0] ? dir : "", dir[0] ? "/" : ""); |
| 514 | pkg_entries_push(entries, strdup(name), strdup(entry)); |
| 515 | free(dir); |
| 516 | } |
| 517 | cbm_yaml_free(root); |
| 518 | } |
| 519 | |
| 520 | /* Extract text content of an XML tag at position p. Returns heap string or NULL. |
| 521 | * p must point to the char after the opening tag's '>'. */ |
no test coverage detected