From: NeilBrown Date: Fri, 3 Oct 2014 03:25:25 +0000 (+1000) Subject: parsergen: don't pass full frame to parser_trace() X-Git-Tag: workingparser~12 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=413a658f832679aa7d212065716aed1bb2ead957 parsergen: don't pass full frame to parser_trace() parser_trace() only uses 2 fields, so only pass those. Signed-off-by: NeilBrown --- diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index 646a8e7..d97f98c 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -2664,7 +2664,8 @@ since the last state which could have been at the start of a line. 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; @@ -2869,7 +2870,7 @@ end inside square brackets. 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) { @@ -2903,9 +2904,9 @@ end inside square brackets. 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); }