From fb0f1db74dfd42c2e0159cd93f6c2a6f778507b2 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Thu, 11 May 2023 12:34:47 +0200 Subject: [PATCH] fix the pretty printer for expression states --- src/runtime/c/pgf/parser.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/c/pgf/parser.cxx b/src/runtime/c/pgf/parser.cxx index 75dee02ca..1d42fb93e 100644 --- a/src/runtime/c/pgf/parser.cxx +++ b/src/runtime/c/pgf/parser.cxx @@ -873,7 +873,7 @@ void PgfParser::print_expr_state_before(PgfPrinter *printer, ExprState *state) void PgfParser::print_expr_state_after(PgfPrinter *printer, ExprState *state) { - for (size_t i = state->n_args; i < state->prod->n_args; i++) { + for (size_t i = state->n_args+1; i < state->prod->n_args; i++) { printer->puts(" ?"); } @@ -890,6 +890,8 @@ void PgfParser::print_expr_state(ExprState *state) printer.nprintf(16, "[%f] ", state->prob); print_expr_state_before(&printer, state); + if (state->prod->n_args > 0) + printer.puts(" ?"); print_expr_state_after(&printer, state); printer.puts("\n");