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.3 by williamc, Tue Nov 23 17:20:40 1999 UTC vs.
Revision 1.5 by williamc, Fri Feb 18 10:32:16 2000 UTC

# Line 15 | Line 15
15   # file()        : return the filename corresponding to url of the document
16   # ProcessedFile() : return the filename corresponding to processed url
17   #                       of the document
18 < # line(number)  : Return the line and fileobj corresponding to number in
18 > # realline(number): Return the line and fileobj corresponding to number in
19   #                 processed file
20   # update()          : update the preprocessed file as required.
21   # store(filename)   :
# Line 36 | Line 36 | sub init {
36                                            "", $self, "", $self);
37   }
38  
39 < sub line {
39 > sub realline {
40          my $self=shift;
41          my $origline=shift;
42  
# Line 45 | Line 45 | sub line {
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 >            $line=$line-($inc->lines()+$startline-$inc->endline())-2;
51 > #+($inc->endline()-$startline);
52                           # n lines in original map to m lines in expanded
53 +        print "Included file lines = ".$inc->lines()." +2 \n";
54 +        print "Start tag= $startline , endtag=".$inc->endline()."\n";
55            }
56            else { # must be in the include file
57 +        print "Passing $line-$startline \n";
58              ($line, $fileob)=$self->{includes}[$i]->
59 <                                        line($line-$startline+1);
59 >                                        realline($line-$startline);
60            }
61          }
62          
63          return ($line, $fileob);
64   }
65  
66 + sub line {
67 +        my $self=shift;
68 +        my $line=$self->{currentparser}->line();
69 +        return $line, $self;
70 + }
71 +
72   sub url {
73          my $self=shift;
74  
# Line 114 | Line 124 | sub update {
124          }
125  
126          if ( $rv != 0 ) {
127 <         print " Need to Update ".$self->url()."\n";
127 >         $self->verbose(" Need to Update ".$self->url());
128            # ---- sort out the preprocessed file in the cache
129            my $newfile=$self->config()->cache()->
130                                  filename($outfile);
# Line 126 | Line 136 | sub update {
136            $self->config->store($self,$self->url());
137          }
138          else {
139 <            print "No Need to Update ".$self->url()."\n";
139 >            $self->verbose("No Need to Update ".$self->url());
140          }
141          return $rv;
142   }
# Line 151 | Line 161 | sub process {
161          $self->parse("include", $self->{fileout}, "include_starttag");
162  
163          $self->{fileout}->close();
164 +        $self->verbose("$fileout Created");
165   }
166  
167   sub store {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines