Returns the indent used */
| 185 | #if SCRIPT_DUMP_TOKENS |
| 186 | /* Returns the indent used */ |
| 187 | static int dump_token(char **str, struct token *token, int indent, char *prefix) |
| 188 | { |
| 189 | if (token->left) |
| 190 | indent = dump_token(str, token->left, indent, "l ") + 1; |
| 191 | |
| 192 | for (int i = 0; i < indent; i++) |
| 193 | tal_append_fmt(str, " "); |
| 194 | |
| 195 | dump_token_shallow(str, token, prefix); |
| 196 | |
| 197 | tal_append_fmt(str, "\n"); |
| 198 | |
| 199 | if (token->middle) |
| 200 | dump_token(str, token->middle, indent, "m "); |
| 201 | |
| 202 | if (token->right) |
| 203 | dump_token(str, token->right, indent + 1, "r "); |
| 204 | |
| 205 | return indent; |
| 206 | } |
| 207 | |
| 208 | static struct splice_script_error *debug_dump(const tal_t *ctx, |
| 209 | struct token **tokens) |
no test coverage detected