MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / dk_from

Function dk_from

src/pipeline/pass_docker.c:510–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510static void dk_from(dk_t *d, TSNode ins) {
511 TSNode spec = {0};
512 TSNode alias = ts_node_child_by_field_name(ins, "as", (uint32_t)strlen("as"));
513 for (uint32_t i = 0; i < ts_node_named_child_count(ins); i++) {
514 if (dk_type(ts_node_named_child(ins, i), "image_spec")) {
515 spec = ts_node_named_child(ins, i);
516 }
517 }
518 const char *ref = ts_node_is_null(spec) ? NULL : dk_expand(d, d->global, dk_text(d, spec));
519 d->stage++;
520 d->local = NULL;
521 d->workdir = "/";
522 d->entry.set = false;
523 d->cmd.set = false;
524 bool stage = ref && dk_is_stage(d, ref);
525 if (ref && !stage) {
526 dk_link(d, ref, "from", dk_line(ins));
527 }
528 if (d->stage < DK_MAX_STAGES) {
529 d->st[d->stage].parent = stage ? dk_stage_of(d, ref) : -1;
530 d->stages[d->stage] = ts_node_is_null(alias) ? NULL : dk_text(d, alias);
531 }
532}
533
534/* JSON string `s` (quoted) unquoted; \\ and \" unescaped. */
535static const char *dk_json_string(dk_t *d, const char *s) {

Callers 1

dk_fileFunction · 0.85

Calls 7

dk_typeFunction · 0.85
dk_expandFunction · 0.85
dk_textFunction · 0.85
dk_is_stageFunction · 0.85
dk_linkFunction · 0.85
dk_lineFunction · 0.85
dk_stage_ofFunction · 0.85

Tested by

no test coverage detected