MCPcopy Create free account
hub / github.com/codr7/hacktical-c / hc_read_id

Function hc_read_id

dsl/dsl.c:390–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void hc_read_id(const char **in,
391 struct hc_list *out,
392 struct hc_sloc *sloc) {
393 struct hc_sloc floc = *sloc;
394 struct hc_memory_stream buf;
395 hc_memory_stream_init(&buf, &hc_malloc_default);
396 hc_defer(hc_stream_deinit(&buf.stream));
397 char c = 0;
398
399 while ((c = **in)) {
400 if (isspace(c) || c == '(' || c == ')') {
401 break;
402 }
403
404 hc_putc(&buf.stream, c);
405 sloc->col++;
406 (*in)++;
407 }
408
409 struct hc_id *f = malloc(sizeof(struct hc_id));
410 hc_id_init(f, floc, out, hc_memory_stream_string(&buf));
411}
412
413bool hc_read_next(const char **in,
414 struct hc_list *out,

Callers 1

hc_read_exprFunction · 0.85

Calls 5

hc_memory_stream_initFunction · 0.85
hc_stream_deinitFunction · 0.85
hc_putcFunction · 0.85
hc_id_initFunction · 0.85
hc_memory_stream_stringFunction · 0.85

Tested by

no test coverage detected