From 8b6504f01bf19191abee9f6766077bb24d83058d Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 4 Jul 2025 10:22:14 +0200 Subject: [PATCH] fixup! algo.ShuntingYard: Use slog() for debugging Signed-off-by: Jan Lindemann --- tools/python/jwutils/algo/ShuntingYard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/python/jwutils/algo/ShuntingYard.py b/tools/python/jwutils/algo/ShuntingYard.py index dc20e6e..f2c23d9 100644 --- a/tools/python/jwutils/algo/ShuntingYard.py +++ b/tools/python/jwutils/algo/ShuntingYard.py @@ -171,11 +171,12 @@ class ShuntingYard(object): # export table.append( (v, action, outq, (s[0] for s in stack), note) ) v = note = '' if self.do_debug: - maxcolwidths = [len(max(x, key=len)) for x in zip(*table)] + maxcolwidths = [len(max(x, key=len)) for x in [zip(*table)]] + caller = get_caller_pos() row = table[0] - print(' '.join('{cell:^{width}}'.format(width=width, cell=cell) for (width, cell) in zip(maxcolwidths, row))) + slog(DEBUG, ' '.join('{cell:^{width}}'.format(width=width, cell=cell) for (width, cell) in zip(maxcolwidths, row))) for row in table[1:]: - print(' '.join('{cell:<{width}}'.format(width=width, cell=cell) for (width, cell) in zip(maxcolwidths, row))) + slog(DEBUG, ' '.join('{cell:<{width}}'.format(width=width, cell=cell) for (width, cell) in zip(maxcolwidths, row))) return table[-1][2] def infix_to_postfix_orig(self, infix):