Mercurial > hg > Members > anatofuz > MoarVM
view tools/colorize_spesh.p6 @ 64:da6d6597bd69 default tip
rollback
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 15 Feb 2019 20:51:54 +0900 |
parents | 2cf249471370 |
children |
line wrap: on
line source
sub colorblock($num, $ver) { "\e[48;5;{ 0x10 + (($num + 1) * 31416) % 216 }m " ~ "\e[38;5;{ 0xE8 + 24 - ($num + $ver * 5) % 24 }m\c[ BLACK LEFT-POINTING TRIANGLE ]" ~ "\e[48;5;0m\c[ BLACK RIGHT-POINTING TRIANGLE ]" ~ "\e[m" } for lines() :eager -> $_ is copy { .subst( /r(<.digit>+) '(' (<.digit>+) ')' /, -> $/ { "r$0\($1\)" ~ colorblock($0, $1) }, :g ).say }