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.7 by williamc, Wed Nov 10 16:21:11 1999 UTC vs.
Revision 1.8 by williamc, Wed Nov 17 17:57:33 1999 UTC

# Line 12 | Line 12
12   #                                    to the desired routines
13   # usegroupchecker(groupchecker)    : Set a groupchecker
14   # parse()                          : Parse the file                            
15 # checkparam($name,$par)    : Exit with an error message if parameter
16 #                             is undefined in tag $name
15   # line()                    : return the current line number of the parse
16   # stream(filehandle)        : stream output to the filehandle if not handled
17   #                               in any other way
# Line 40 | Line 38 | sub stream {
38          $self->{stream}=shift;
39   }
40  
41 + sub streamexclude {
42 +        my $self=shift;
43 +        my $tag=shift;
44 +
45 +        $tag=~tr/A-Z/a-z/;
46 +        $self->{streamexclude}{$tag}=1;
47 + }
48 +
49   sub _initialise (hash1) {
50          my $self=shift;
51          $self->{filename}=shift;
# Line 76 | Line 82 | sub parse {
82          $self->{linecount}=0;
83          $self->_resetvars();
84          $self->{streamstore}="";
85 +        $self->{streamtmp}="";
86  
87          # Open the file
88          use FileHandle;
# Line 99 | Line 106 | sub parse {
106          $self->_printstream();
107   }
108  
102 sub checkparam($name, $key) {
103        my $self=shift;
104        my $name=shift;
105        my $key=shift;
106
107        if ( ! defined $self->{tagvar}{$key} ) {
108           print "Switcher: Badly formed $name tag -".
109                        " undefined $key parameter\n";
110           exit 1;
111        }
112 }
113
109   #
110   # return the current line number
111   #
# Line 178 | Line 173 | sub _opentag {
173          my $char;
174  
175          # Close the last text segment
176 +        $self->{streamtmp}=$self->_popstream();
177          $self->_calltag($self->{textcontext}, $self->{textcontext},
178                                                          $self->_getstore());
179          $self->_resetstore();
180          $self->_resetlabels();
181  
186        $self->{scramtmp}=$self->_popstream();
182          # Do we have an opening or closing tag?
183          if ( ($char=$self->_nextchar()) eq "/" ) { #we have a closing tag
184            $self->{tagcontext}="endtag";
# Line 258 | Line 253 | sub _calltag {
253            }
254          }
255          
256 <        if ( ! $found ) {
256 >        # stream function
257 >        if ( ! exists $self->{streamexclude}{$tagroutine} ) {
258              $self->_printstream();
259          }
260          $self->_clearstream();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines