Revision 426e3722a9c5ec612c3f039957cb698295a61cd4 authored by Alon Zakai on 27 January 2015, 23:26:47 UTC, committed by Alon Zakai on 27 January 2015, 23:26:47 UTC
1 parent 7fb1e1f
Raw File
autodebugger_indenter.py
'''
Autodebugger output contains -1 for function entry and -2 for function exit.
This script will indent the output nicely
'''

import os, sys

lines = sys.stdin.read().split('\n')

depth = 0
for i in range(len(lines)):
  line = lines[i]
  if line.startswith('AD:-2,'):
    depth -= 1
  print str(depth) + '|' + line
  if line.startswith('AD:-1,'):
    depth += 1

back to top