You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/10/06 08:20:57 UTC

cvs commit: xml-xerces/perl preSwig.pl

jasons      01/10/05 23:20:57

  Modified:    perl     preSwig.pl
  Log:
  	* preSwig.pl (Repository):
  	No longer handles operator overloading.
  	Now handles multiple classes in one header file
  
  Revision  Changes    Path
  1.2       +17 -6     xml-xerces/perl/preSwig.pl
  
  Index: preSwig.pl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/preSwig.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- preSwig.pl	2001/09/16 15:16:20	1.1
  +++ preSwig.pl	2001/10/06 06:20:57	1.2
  @@ -39,23 +39,34 @@
   open(OUT,">$outfile") or die "Couldn't open $outfile for writing";
   
   my $in_class;
  +my $seen_class = 0;
   while (<IN>) {
  -  if (/class/ && !/;\s*$/) {
  +  if (/^class/ && !/;\s*$/) {
       $in_class = 1;
     }
     if ($in_class && /\{\s*$/) {
  +    $seen_class = 1;
       # we found the class definition
       print OUT;
  -    my $subst_func = sub {};
  -    skip_to_closing_brace(\*IN,$subst_func,\*OUT);
  -    last;
  +    skip_to_closing_brace(\*IN,\&substitute_line,\*OUT);
  +#    print OUT "\n#endif";
  +    $in_class = 0;
  +    next;
     }
     if ($in_class && /;\s*$/) {
       $in_class = 0;
     }
  -  print OUT;
  +  print OUT 
  +    if $in_class or not $seen_class;
   }
  +print OUT "\n#endif";
   close(IN);
   close(OUT);
  -
   
  +sub substitute_line {
  +#   if ($_[0] =~ /operator/) {
  +#     $_[0] =~ s/operator\s*=\s*\(/operator_assignment\(/;
  +#     $_[0] =~ s/operator\s*!=\s*\(/operator_not_equal_to\(/;
  +#     $_[0] =~ s/operator\s*==\s*\(/operator_equal_to\(/;
  +#   }
  +}
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org