From: kramm Date: Sun, 24 Oct 2004 15:04:24 +0000 (+0000) Subject: don't try to compile with lang!=swfc. X-Git-Tag: release-0-6-3~264 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=0703a05cbcae0bec44d6f6cb6f2ec7910559f7bf don't try to compile with lang!=swfc. --- 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;