mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 01:52:56 +01:00
fixup! algo.ShuntingYard: Use slog() for debugging
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
49e9b5ab5d
commit
8b6504f01b
1 changed files with 4 additions and 3 deletions
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue