fixup! algo.ShuntingYard: Use slog() for debugging

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-07-04 10:22:14 +02:00
commit 8b6504f01b

View file

@ -171,11 +171,12 @@ class ShuntingYard(object): # export
table.append( (v, action, outq, (s[0] for s in stack), note) ) table.append( (v, action, outq, (s[0] for s in stack), note) )
v = note = '' v = note = ''
if self.do_debug: 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] 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:]: 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] return table[-1][2]
def infix_to_postfix_orig(self, infix): def infix_to_postfix_orig(self, infix):