16 |
|
# is undefined in tag $name |
17 |
|
# line() : return the current line number of the parse |
18 |
|
|
19 |
< |
package Switcher; |
19 |
> |
package ActiveDoc::Switcher; |
20 |
|
require 5.001; |
21 |
|
use Carp; |
22 |
|
|
26 |
|
my $objectname=shift; |
27 |
|
my $groupchecker=shift; |
28 |
|
|
29 |
< |
my $self = {}; |
29 |
> |
$self = {}; |
30 |
|
$self->{allw}=$objectname; |
31 |
|
bless $self, $class; |
32 |
|
$self->_initialise($file); |
44 |
|
|
45 |
|
# Add a default TagContainer |
46 |
|
use ActiveDoc::TagContainer; |
47 |
< |
$self->{tagcontainer}=TagContainer->new(); |
47 |
> |
$self->{tagcontainer}=ActiveDoc::TagContainer->new(); |
48 |
|
|
49 |
|
} |
50 |
|
|
65 |
|
sub parse { |
66 |
|
my $self=shift; |
67 |
|
my $char; |
68 |
+ |
my $buf; |
69 |
|
$self->{linecount}=0; |
70 |
|
$self->_resetvars(); |
71 |
|
|
72 |
|
# Open the file |
73 |
|
use FileHandle; |
74 |
< |
my $filehandle=FileHandle->new(); |
75 |
< |
open( $filehandle , "$self->{filename}" ) |
76 |
< |
or carp "Switcher: Cannot open $self->{filename} $! \n"; |
74 |
> |
my $filehandle; |
75 |
> |
$filehandle=FileHandle->new(); |
76 |
> |
$filehandle->open("<$self->{filename}") |
77 |
> |
or return 1; |
78 |
> |
# The buffering seems all messed up - best not to use it |
79 |
> |
$filehandle->setvbuf($buf, _IONBF, 300); |
80 |
|
|
81 |
|
# Start file processing |
82 |
< |
while ( <$filehandle> ) { |
82 |
> |
while ( ($_=<$filehandle>) ) { |
83 |
|
$self->{linecount}++; |
84 |
|
$self->{currentline}=$_; |
85 |
+ |
if ( $self->{linecount} > 5 ) { |
86 |
+ |
$DB::single=1; |
87 |
+ |
} |
88 |
|
$self->{stringpos}=0; |
89 |
|
while ( ($char=$self->_nextchar()) ne "" ) { |
90 |
|
$self->_checkchar($char); |
91 |
|
} # end char while |
92 |
|
} # End String while loop |
93 |
|
close $filehandle; |
94 |
+ |
1; |
95 |
|
} |
96 |
|
|
97 |
|
sub checkparam($name, $key) { |