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

Comparing COMP/SCRAM/src/ActiveDoc/Switcher.pm (file contents):
Revision 1.12 by williamc, Tue Nov 23 17:20:40 1999 UTC vs.
Revision 1.13.2.5 by williamc, Fri May 12 15:00:54 2000 UTC

# Line 105 | Line 105 | sub parse {
105           } # end char while
106          } # End String while loop
107          undef $filehandle;
108 <        $self->_printstream();
108 >        # make sure we close the last buffer
109 >        $self->_calltag($self->{textcontext}, $self->{textcontext},
110 >                                                        $self->_getstore());
111 >        #$self->_printstream();
112   }
113  
114   #
# Line 168 | Line 171 | sub _nextchar() {
171          my $self=shift;
172          my $char;
173          $char=substr($self->{currentline},$self->{stringpos}++,1);
174 < #       print "Debug : Fetching character $char\n";
174 >        #print "Debug : Fetching character $char\n";
175  
176          # Keep a record for any stream processes
177          $self->{streamstore}=$self->{streamstore}.$char;
# Line 212 | Line 215 | sub _closetag {
215          $self->_closelabel();
216          
217          # -- Call the associated tag function if appropriate
218 <        $tagroutine=$self->{tagname}."_".$self->{tagcontext};
219 <        $self->_calltag($tagroutine, $self->{tagname},
218 >        if ( defined $self->{tagname} ) {
219 >         $tagroutine=$self->{tagname}."_".$self->{tagcontext};
220 >         $self->_calltag($tagroutine, $self->{tagname},
221                                                          $self->{tagvar});
222 <        #print "\nDebug : Closing Tag $tagroutine\n";
222 >         #print "\nDebug : Closing Tag $tagroutine\n";
223  
224 <        # -- Now make sure the text context is set for calling routines to
225 <        # -- deal with text portions outside of tags
226 <        if ( $self->{tagcontext} eq "starttag" ) {
227 <          push @{$self->{textstack}} , $self->{textcontext};
228 <          $self->{textcontext}=$self->{tagname};
229 <        }
230 <        else {
224 >         # -- Now make sure the text context is set for calling routines to
225 >         # -- deal with text portions outside of tags
226 >         if ( ($self->{tagcontext} eq "starttag") ) {
227 >           if ( $self->{tagcontainer}->definescontext($self->{tagname}) ) {
228 >              push @{$self->{textstack}} , $self->{textcontext};
229 >              $self->{textcontext}=$self->{tagname};
230 >           }
231 >         }
232 >         else {
233            if ( $#{$self->{textstack}} > -1 ) {
234 <            if ( $self->{textcontext} eq $self->{tagname} ) {  
235 <               $self->{textcontext}=pop @{$self->{textstack}};
236 <            }
234 >           if ( $self->{textcontext} eq $self->{tagname} ) {    
235 >            if ( $self->{tagcontainer}->definescontext($self->{tagname}) ) {
236 >              # -- watch out for valid tags we ignore in this parse
237 >              $self->{textcontext}=pop @{$self->{textstack}};
238 >            }
239 >           }
240              else { #The tag we are closing is not the last one so
241                     # we keep our current context.
242                 $self->_removefromstack($self->{tagname},$self->{textstack});
# Line 235 | Line 244 | sub _closetag {
244  
245            }
246            else { # more close tags than open ones
247 +            if ( $self->{tagcontainer}->definescontext($self->{tagname}) ) {
248               print "Warning : Unmatched </...> tag on line ".
249                                          $self->line()."\n";    
250 +            }
251            }
252 +         }
253          }
254          # Reset context back to text
255          $self->{tagcontext}="text";
# Line 373 | Line 385 | sub _closelabel {
385  
386          # Do we have a label name?
387          if ( $self->{lastlabel} ne "" ) {
388 <         $self->{tagvar}{$self->{lastlabel}}=$self->_getstore();
388 >         (my $label=$self->{lastlabel})=~tr[A-Z][a-z];
389 >         $self->{tagvar}{$label}=$self->_getstore();
390           $self->{lastlabel}="";
391          }
392          elsif ( $self->_getstore() ne "") {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines