X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=doc%2Fcodebeautifier.pl;h=517bd69e6aaa122423a9f249ee2d0c5c0687bd45;hb=0703a05cbcae0bec44d6f6cb6f2ec7910559f7bf;hp=6225c83ba1575763ddaf338ebe1ae947f2e0f1c5;hpb=038891d498de3a4069e1e16cdc0e9a36efc5c248;p=swftools.git diff --git a/doc/codebeautifier.pl b/doc/codebeautifier.pl index 6225c83..517bd69 100644 --- a/doc/codebeautifier.pl +++ b/doc/codebeautifier.pl @@ -1,18 +1,25 @@ while() { - if(/\[CALLPERL .*left\]/ ... /\[CALLPERL end\]/) { + if(/\[CALLPERL\s+(.*)\s+left\]/ ... /\[CALLPERL end\]/) { + $lang = $1 if($1); $code .= $_ if(!/CALLPERL/); $name = $1 if(/.flash.*name=([^&][^ ]*)/); $name = $1 if(/.flash.*name="([^&]*)"/); + chomp $name; } elsif(/\[CALLPERL .*right\]/ ... /\[CALLPERL end\]/) { $highlight .= $_ if(!/CALLPERL/); } - elsif ($code ne "") { + elsif ($code ne "" && ($lang eq "swfc" || $lang eq "sc")) { $code =~ s/"/"/g; + +# print stderr "Warning: ttf->swf\n" if($code =~ s/Arial.ttf/Arial.swf/g); + open(fi, ">tmp.sc");print fi $code;close(fi); - system("swfc tmp.sc"); + print stderr "[$lang] swfc tmp.sc ($name)\n"; + system("../src/swfc tmp.sc >&2"); ($embed = `swfdump -e $name`) =~ /WIDTH="([^"]*)"/; + system("cp $name data"); $width = $1; print ""; print $embed; @@ -21,6 +28,9 @@ while() print; unlink "tmp.sc"; } + elsif ($code ne "") { + $code=""; + } elsif ($highlight ne "") { $highlight =~ s/^\n\s*//g; $highlight =~ s/\s*\n$//g;