From 0703a05cbcae0bec44d6f6cb6f2ec7910559f7bf Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 24 Oct 2004 15:04:24 +0000 Subject: [PATCH] don't try to compile with lang!=swfc. --- doc/codebeautifier.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/codebeautifier.pl b/doc/codebeautifier.pl index 8ecfc29..517bd69 100644 --- a/doc/codebeautifier.pl +++ b/doc/codebeautifier.pl @@ -1,6 +1,7 @@ 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="([^&]*)"/); @@ -9,13 +10,13 @@ while() 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); - print stderr "swfc tmp.sc ($name)\n"; + print stderr "[$lang] swfc tmp.sc ($name)\n"; system("../src/swfc tmp.sc >&2"); ($embed = `swfdump -e $name`) =~ /WIDTH="([^"]*)"/; system("cp $name data"); @@ -27,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; -- 1.7.10.4