diff options
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -1501,17 +1501,30 @@ val rlrec(parser_t *parser, val form, val line) return form; } -val rlcp_tree(val to, val from) +static val rlcp_tree_rec(val to, val from, struct circ_stack *up) { val ret = to; - for (; consp(to); to = cdr(to)) { + while (consp(to)) { + val a = car(to); + struct circ_stack rlcs = { up, a }; rlcp(to, from); - rlcp_tree(car(to), from); + if (!parser_callgraph_circ_check(up, a)) + break; + rlcp_tree_rec(a, from, &rlcs); + to = cdr(to); + if (!parser_callgraph_circ_check(up, to)) + break; } return ret; } + +val rlcp_tree(val to, val from) +{ + return rlcp_tree_rec(to, from, 0); +} + static wchar_t char_from_name(const wchar_t *name) { static struct { |