2015-01-15 00:23:46 -08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import re
|
|
|
|
import sys
|
2012-04-05 20:59:07 -07:00
|
|
|
|
2015-01-15 00:23:46 -08:00
|
|
|
indent = 0
|
|
|
|
more_re = re.compile(r"^rust: ~\">>")
|
|
|
|
less_re = re.compile(r"^rust: ~\"<<")
|
|
|
|
while True:
|
|
|
|
line = sys.stdin.readline()
|
|
|
|
if not line:
|
|
|
|
break
|
2012-04-05 20:59:07 -07:00
|
|
|
|
2015-01-15 00:23:46 -08:00
|
|
|
if more_re.match(line):
|
|
|
|
indent += 1
|
2012-04-21 10:04:58 -07:00
|
|
|
|
2017-11-16 12:39:20 -05:00
|
|
|
print("%03d %s%s" % (indent, " " * indent, line.strip()))
|
2015-01-15 00:23:46 -08:00
|
|
|
|
|
|
|
if less_re.match(line):
|
|
|
|
indent -= 1
|