From: FutureBoyNil <fut...@us...> - 2009-04-12 22:20:54
|
Update of /cvsroot/sphere/sphere/source/engine In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19456/engine Modified Files: make_doc_functions.perl Log Message: fixed some generated typo's when if statements are in the parameters Index: make_doc_functions.perl =================================================================== RCS file: /cvsroot/sphere/sphere/source/engine/make_doc_functions.perl,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** make_doc_functions.perl 14 Mar 2009 02:18:01 -0000 1.16 --- make_doc_functions.perl 12 Apr 2009 22:20:41 -0000 1.17 *************** *** 6,12 **** die "Usage: $0 <type>\n" . " e.g. $0 txt > doc_functions.txt\n" ! . " e.g. $0 html > doc_functions.html\n" unless (@ARGV == 1); ! die "type must be either txt or html\n" unless ($ARGV[0] eq "txt" || $ARGV[0] eq "html"); my $output_type = $ARGV[0]; --- 6,13 ---- die "Usage: $0 <type>\n" . " e.g. $0 txt > doc_functions.txt\n" ! . " e.g. $0 html > doc_functions.html\n" ! . " e.g. $0 api |" . 'perl -e "@a=<STDIN>;print sort @a"' . "> scintillasphere.api\n" unless (@ARGV == 1); ! die "type must be either txt or html\n" unless ($ARGV[0] eq "txt" || $ARGV[0] eq "html"|| $ARGV[0] eq "api"); my $output_type = $ARGV[0]; *************** *** 20,23 **** --- 21,28 ---- } + sub is_api { + return $output_type eq "api"; + } + ########################################################### *************** *** 30,34 **** return "<div class=\"$class\">"; } ! return ""; } --- 35,39 ---- return "<div class=\"$class\">"; } ! return " \"" if(is_api()); return ""; } *************** *** 40,44 **** return "</div>\n"; } ! return "\n"; } --- 45,49 ---- return "</div>\n"; } ! return " \"\n" if(is_api()); return "\n"; } *************** *** 54,62 **** $escaped =~ s/</</g; $escaped =~ s/>/>/g; - $escaped =~ s/\\/"/g; return $escaped; } - ########################################################### --- 59,65 ---- *************** *** 320,328 **** } ! print &start_of_line() . "This file is automatically generated, do not edit!" . (&is_html() ? "<br />" : "") . &end_of_line(); foreach my $line (@lines) { my $no_desc_text = 0; if ( $line =~ m/^( +)-/) { --- 323,380 ---- } ! if(!is_api()){ ! print &start_of_line() . "This file is automatically generated, do not edit!" . (&is_html() ? "<br />" : "") . &end_of_line(); ! } ! ! my $constmode=0; foreach my $line (@lines) { my $no_desc_text = 0; + + if ($line =~ /constants\[\]/){ + $constmode = 1; + if (!is_api()) { + print &start_of_line('section') . "*** CONSTANTS ***" . &end_of_line(). (&is_html() ? "</br>" : "") ; + } + } + + if ($constmode && $line =~ /^#/){ + $constmode = 0; + if(is_html()){ + print "<br />"; + }elsif(!is_api()){ + print "\n"; + } + } + + if ($constmode && ($line =~ m/CONSTANT\((.*)\)/)) { + if(is_api()){ + print " \"$1 \"\n"; + }else{ + print &start_of_line('constant') . $1 . &end_of_line('constant') . "\n"; + } + } + + if ($line =~ /^#define\s+(.*)CONSTANT/){ + $constmode = 1; + if (!is_api()) { + print &start_of_line('section') . "*** ${1}CONSTANTS ***" . &end_of_line(). (&is_html() ? "</br>" : "") + } + } + + if ($constmode && ($line =~ m/\/\/(.*)\s*/)) { + if(!is_api()){ + print &start_of_line('constantheader') . $1 . &end_of_line('constantheader') . "\n"; + } + } + + if ($constmode && ($line =~ m/"(.*)"/)) { + if(is_api()){ + print " \"$1 \"\n"; + }else{ + print &start_of_line('constant') . $1 . &end_of_line('constant') . "\n"; + } + } if ( $line =~ m/^( +)-/) { *************** *** 344,351 **** # // section: section_name // if ($line =~ m/\/\/ section: (.*?) \/\//) { print "\n"; print &start_of_line('section') . "*** $1 ***" . &end_of_line(). (&is_html() ? "</br>" : "") ; ! } if ($in_comment == 0 && $in_func == 0 && $in_method == 0 && $in_prop == 0) { --- 396,404 ---- # // section: section_name // + if(!is_api()){ if ($line =~ m/\/\/ section: (.*?) \/\//) { print "\n"; print &start_of_line('section') . "*** $1 ***" . &end_of_line(). (&is_html() ? "</br>" : "") ; ! }} if ($in_comment == 0 && $in_func == 0 && $in_method == 0 && $in_prop == 0) { *************** *** 667,670 **** --- 720,726 ---- $return_type = "ParticleDescendants"; } + elsif ($method_name =~/ssSurfaceFindColor/i) { + $return_type = "Object"; + } else { *************** *** 679,683 **** unless ($func_name eq "name") { ! print function_to_string($func_name, $func_minargs, $desc_text, $return_type, @args, @arg_types) . "\n"; } --- 735,745 ---- unless ($func_name eq "name") { ! if(!is_api()){ ! print function_to_string($func_name, $func_minargs, $desc_text, $return_type, @args, @arg_types) . "\n"; ! }else{ ! grep (s/if\s*\([^\)]*\)\s*//g,@args); ! print ' "'.$func_name . &ssobject_method_to_jsobject_method($method_name)."(".(join(",",@args)).") \"\n"; ! ! } } *************** *** 715,719 **** } ! print method_to_string(&ssobject_name_to_jsobject_name($method_object) . "." . &ssobject_method_to_jsobject_method($method_name), $method_minargs, $desc_text, $return_type, @args, @arg_types) . "\n"; } --- 777,786 ---- } ! if(!is_api()){ ! print method_to_string(&ssobject_name_to_jsobject_name($method_object) . "." . &ssobject_method_to_jsobject_method($method_name), $method_minargs, $desc_text, $return_type, @args, @arg_types) . "\n"; ! }else{ ! grep (s/if\s*\([^\)]*\)\s*//g,@args); ! print " \"".&ssobject_name_to_jsobject_name($method_object) . "." . &ssobject_method_to_jsobject_method($method_name)."(".(join(",",@args)).") \"\n"; ! } } *************** *** 748,754 **** $arg=~s/.*object->//; $arg=~s/->/./; print &start_of_line('property') . "$arg" . &end_of_line('property'); } ! print &start_of_line() . "$desc_text" . &end_of_line(); } --- 815,824 ---- $arg=~s/.*object->//; $arg=~s/->/./; + $arg=~s/\s*$//; print &start_of_line('property') . "$arg" . &end_of_line('property'); } ! if(!is_api()){ ! print &start_of_line() . "$desc_text" . &end_of_line(); ! } } *************** *** 778,783 **** if ($prev_method_object ne $method_object) { ! print "\n"; ! print &start_of_line('jsobject', uc(&ssobject_name_to_jsobject_name($method_object))) . uc(&ssobject_name_to_jsobject_name($method_object)) . &end_of_line('jsobject'); if ($method_object eq "SS_BYTEARRAY") { --- 848,855 ---- if ($prev_method_object ne $method_object) { ! print "\n" unless(is_api()); ! if(!is_api()){ ! print &start_of_line('jsobject', uc(&ssobject_name_to_jsobject_name($method_object))) . uc(&ssobject_name_to_jsobject_name($method_object)) . &end_of_line('jsobject'); ! } if ($method_object eq "SS_BYTEARRAY") { *************** *** 793,796 **** --- 865,881 ---- print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".done" . &end_of_line('property') . "\n"; } + if ($method_object eq "SS_SPRITESET") { + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".images" . &end_of_line('property') . "\n"; + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".directions[].name" . &end_of_line('property') . "\n"; + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".directions[].frames[].index" . &end_of_line('property') . "\n"; + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".directions[].frames[].delay" . &end_of_line('property') . "\n"; + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".base.x1" . &end_of_line('property') . "\n"; + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".base.y1" . &end_of_line('property') . "\n"; + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".base.x2" . &end_of_line('property') . "\n"; + print &start_of_line('property') . &ssobject_name_to_jsobject_name($method_object).".base.y2" . &end_of_line('property') . "\n"; + } + + + } |