ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/PreProcessedFile.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/PreProcessedFile.pm (file contents):
Revision 1.4 by williamc, Mon Nov 29 17:32:48 1999 UTC vs.
Revision 1.6 by williamc, Mon Feb 21 14:30:08 2000 UTC

# Line 45 | Line 45 | sub realline {
45          for(my $i=0; $i<=$#{$self->{includesdesc}}; $i++ ) {
46            $inc=$self->{includesdesc}[$i];
47            $startline=$inc->startline();
48 <          last if ( $line < $startline );
49 <          if ( $line > ($inc->lines()+$startline) ) {
50 <            $line=$line-$inc->lines()+1+($inc->endline()-$startline);
48 >          last if ( $line <= $startline );
49 >          if ( $line >= ($inc->lines()+$startline+2) ) {
50 >                                        # take out the 2 carriage returns added
51 >            $line=$line-($inc->lines()+$startline-$inc->endline())-2;
52 > #+($inc->endline()-$startline);
53                           # n lines in original map to m lines in expanded
54 +        print "Included file lines = ".$inc->lines()." +2 \n";
55 +        print "Start tag= $startline , endtag=".$inc->endline()."\n";
56            }
57            else { # must be in the include file
58 +        print "Passing $line-$startline \n";
59              ($line, $fileob)=$self->{includes}[$i]->
60 <                                        line($line-$startline+1);
60 >                                        realline($line-$startline);
61            }
62          }
63          
# Line 69 | Line 74 | sub url {
74          my $self=shift;
75  
76          if ( @_ ) {
77 <          my $url=shift;
78 <          ($self->{url}, $file)=$self->{urlhandler}->get($url);
79 <        }
80 <        else {
81 <          $self->{url};
82 <        }
77 >        my $url=shift;
78 >          ($self->{url}, $file)=$self->{urlhandler}->get($url);
79 >        }
80 >        else {
81 >          $self->{url};
82 >        }
83   }
84  
85   sub ProcessedFile {
# Line 89 | Line 94 | sub file {
94          return $file;
95   }
96  
97 + sub ProcessFile {
98 +        my $self=shift;
99 +        return $self->file();
100 + }
101  
102   sub update {
103          my $self=shift;
# Line 120 | Line 129 | sub update {
129          }
130  
131          if ( $rv != 0 ) {
132 <         print " Need to Update ".$self->url()."\n";
132 >         $self->verbose(" Need to Update ".$self->url());
133            # ---- sort out the preprocessed file in the cache
134            my $newfile=$self->config()->cache()->
135                                  filename($outfile);
# Line 132 | Line 141 | sub update {
141            $self->config->store($self,$self->url());
142          }
143          else {
144 <            print "No Need to Update ".$self->url()."\n";
144 >            $self->verbose("No Need to Update ".$self->url());
145          }
146          return $rv;
147   }
# Line 157 | Line 166 | sub process {
166          $self->parse("include", $self->{fileout}, "include_starttag");
167  
168          $self->{fileout}->close();
169 +        $self->verbose("$fileout Created");
170   }
171  
172   sub store {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines