164 |
if ($line =~ s/^<([a-z0-9]+)\s*//) { |
if ($line =~ s/^<([a-z0-9]+)\s*//) { |
165 |
my $tagname = $1; |
my $tagname = $1; |
166 |
push @token, {type => 'start', value => $tagname}; |
push @token, {type => 'start', value => $tagname}; |
167 |
while ($line =~ s/^([a-z-]+)\s*=\s*"([^"]*)"\s*//) { |
while ($line =~ s/^([a-z-]+)\s*=\s*(?>"([^"]*)"|([^\s">]*))\s*//) { |
168 |
push @token, {type => $1, value => $attrvalue->($2)}; |
push @token, {type => $1, |
169 |
|
value => $attrvalue->(defined $2 ? $2 : $3)}; |
170 |
} |
} |
171 |
$line =~ s#^/?\s*>##; |
$line =~ s#^/?\s*>##; |
172 |
push @token, {type => 'end', value => $tagname} |
push @token, {type => 'end', value => $tagname} |