MCPcopy Create free account
hub / github.com/antirez/ds4 / copy_span

Function copy_span

ds4_eval.c:3055–3062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3053 /* Restrict to the final answer line: digits after it (continued
3054 * reasoning, footnotes, years) must not override the answer. */
3055 const char *nl = memchr(answer, '\n', (size_t)(end - answer));
3056 if (nl) end = nl;
3057 /* When the line shows arithmetic ("m+n = 256+37 = 293") the stated
3058 * result is the right-hand side of the LAST '='. Otherwise the first
3059 * integer on the line is the answer (keeps "Final answer: 082"). */
3060 const char *eq = NULL;
3061 for (const char *r = answer; r < end; r++) if (*r == '=') eq = r;
3062 if (scan_first_integer(eq ? eq + 1 : answer, end, dst, dstlen)) return;
3063 if (eq && scan_first_integer(answer, end, dst, dstlen)) return;
3064 }
3065

Callers 1

trace_get_line_fieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected