fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
367 B19 linesraw
1#!/usr/bin/env python
2import re
3import sys
4
5indent = 0
6more_re = re.compile(r"^rust: ~\">>")
7less_re = re.compile(r"^rust: ~\"<<")
8while True:
9    line = sys.stdin.readline()
10    if not line:
11        break
12
13    if more_re.match(line):
14        indent += 1
15
16    print("%03d %s%s" % (indent, " " * indent, line.strip()))
17
18    if less_re.match(line):
19        indent -= 1