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

Function spawn_expr_literal

internal/cbm/spawn_patterns.c:637–650  ·  view source on GitHub ↗

The program literal an argument spells: a leading literal, or the first * element of a collection when that element is one. A program held in a * variable (`[binary, "--version"]`) is no literal: the arguments after it * are not the program. */

Source from the content-addressed store, hash-verified

635 * variable (`[binary, "--version"]`) is no literal: the arguments after it
636 * are not the program. */
637static bool spawn_expr_literal(const char *expr, char *out, size_t n) {
638 char element[CBM_SZ_256];
639 for (int depth = 0; depth < 3; depth++) {
640 expr = spawn_skip_label(spawn_skip_space(expr));
641 if (spawn_leading_literal(expr, out, n)) {
642 return true;
643 }
644 if (!spawn_first_element(expr, element, sizeof(element))) {
645 return false;
646 }
647 expr = element;
648 }
649 return false;
650}
651
652/* A literal from the argument at `index`. Tcl words are literals unquoted;
653 * elsewhere an unquoted argument counts only when the extractor itself read

Callers 1

spawn_arg_literalFunction · 0.85

Calls 4

spawn_skip_labelFunction · 0.85
spawn_skip_spaceFunction · 0.85
spawn_leading_literalFunction · 0.85
spawn_first_elementFunction · 0.85

Tested by

no test coverage detected