MCPcopy Create free account
hub / github.com/ElementsProject/lightning / clean_whitespace

Function clean_whitespace

common/splice_script.c:518–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518static struct splice_script_error *clean_whitespace(const tal_t *ctx,
519 struct token ***tokens_inout)
520{
521 struct token **input = *tokens_inout;
522 struct token **tokens = tal_arr(ctx, struct token *, tal_count(input));
523 size_t n = 0;
524
525 for (size_t i = 0; i < tal_count(input); i++)
526 if (input[i]->type != TOK_CHAR || !is_whitespace(input[i]->c))
527 tokens[n++] = tal_steal(tokens, input[i]);
528
529 tal_free(input);
530 tal_resize(&tokens, n);
531 *tokens_inout = tokens;
532 return NULL;
533}
534
535/* Returns point in str that starts match of suffix. */
536static char *find_suffix(char *str, char *suffix)

Callers 1

parse_splice_scriptFunction · 0.85

Calls 2

is_whitespaceFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected