Mercurial > hg > Members > kono > os9 > sbc09
comparison TL1/toasm.pl @ 118:8f2154d95a04
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 04 Jan 2019 10:47:39 +0900 |
parents | f8f44153f8c1 |
children |
comparison
equal
deleted
inserted
replaced
117:f8f44153f8c1 | 118:8f2154d95a04 |
---|---|
1 #!/usr/bin/perl | 1 #!/usr/bin/perl |
2 | 2 |
3 my $indent = 7; | |
3 while(<>) { | 4 while(<>) { |
4 s/\r\n$//; | 5 s/\r\n$//; |
5 s/^\d+ //; | 6 s/^\d+ //; |
7 s/^ /" "x$indent/e; | |
8 if (/^([a-zA-Z0-9]+) /) { | |
9 my $w = $1; | |
10 if (length $w < $indent) { | |
11 my $s = " "x($indent-length $w); | |
12 s/ /$s/e; | |
13 } | |
14 } | |
6 print $_,"\n" | 15 print $_,"\n" |
7 } | 16 } |