# HG changeset patch # User HackEso # Date 1573747999 0 # Node ID b413473a9ec3d264ac93ea2401d9649ecbebcc03 # Parent 76de149fb2bee9d99e8b31d6d254ce2e7d2d5f23 ` cp tmp/asmbf-1.1.1/labels.pl /hackenv/bin diff -r 76de149fb2be -r b413473a9ec3 bin/labels.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/labels.pl Thu Nov 14 16:13:19 2019 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/perl + +# asm2bf label preprocessor. +# C'mon, who doesn't love regexes? + +# Released to the public domain by Krzysztof Szewczyk. + +$n=0;%o=();$_=do{local$/;<>};s/^[ \t]*@([A-Za-z_]+).*$/$o{$1}=++$n;'lbl '.$n."\n";/gem; +s/(%[A-Za-z_]+|"[^"\n]*%[A-Za-z_]+)/substr($1,0,1)eq'"'?$1:%o{substr$1,1}/ge;print;