if (!tk)
tk = tok_copy(token_next(tokens));
next.sym = tk->num;
- parser_trace(trace, &p, &next, tk, states, non_term, config->known_count);
+ parser_trace(trace, &p, next.indents, !next.since_newline,
+ tk, states, non_term, config->known_count);
if (next.sym == TK_in) {
tos->indents += 1;
fprintf(trace, ") ");
}
- void parser_trace(FILE *trace, struct parser *p, struct frame *n,
+ void parser_trace(FILE *trace, struct parser *p, int indents, int start_of_line,
struct token *tk, const struct state states[],
const char *non_term[], int knowns)
{
fputs(reserved_words[tk->num], trace);
else
text_dump(trace, tk->txt, 20);
- if (n->indents)
- fprintf(trace, ".%d", n->indents);
- if (n->since_newline == 0)
+ if (indents)
+ fprintf(trace, ".%d", indents);
+ if (start_of_line)
fputs("/", trace);
fputs("]", trace);
}