+ if ($text{$t}->[0]->type == TmplTokenType::TEXT_PARAMETRIZED) {
+ my($token, $n) = ($text{$t}->[0], 0);
+ printf OUTPUT "#. For the first occurrence,\n"
+ if @{$text{$t}} > 1 && $token->parameters_and_fields > 0;
+ for my $param ($token->parameters_and_fields) {
+ $n += 1;
+ my $type = $param->type;
+ my $subtype = ($type == TmplTokenType::TAG
+ && $param->string =~ /^<input\b/is?
+ $param->attributes->{'type'}->[1]: undef);
+ my $fmt = TmplTokenizer::_formalize( $param );
+ $fmt =~ s/^%/%$n\$/;
+ if ($type == TmplTokenType::DIRECTIVE) {
+ $type = $param->string =~ /(TMPL_[A-Z]+)+/is? $1: 'ERROR';
+ my $name = $param->string =~ /\bname=(["']?)([^\s"']+)\1/is?
+ $2: undef;
+ printf OUTPUT "#. %s: %s\n", $fmt,
+ "$type" . (defined $name? " name=$name": '');
+ } else {
+ my $name = $param->attributes->{'name'};
+ my $value = $param->attributes->{'value'}
+ unless $subtype =~ /^(?:text)$/;
+ printf OUTPUT "#. %s: %s\n", $fmt, "type=$subtype"
+ . (defined $name? " name=$name->[1]": '')
+ . (defined $value? " value=$value->[1]": '');
+ }
+ }
+ } elsif ($text{$t}->[0]->type == TmplTokenType::TAG) {
+ my($token) = ($text{$t}->[0]);
+ printf OUTPUT "#. For the first occurrence,\n"
+ if @{$text{$t}} > 1 && $token->parameters_and_fields > 0;
+ if ($token->string =~ /^<meta\b/is) {
+ my $type = $token->attributes->{'http-equiv'}->[1];
+ print OUTPUT "#. META http-equiv=$type\n" if defined $type;
+ } elsif ($token->string =~ /^<([a-z0-9]+)/is) {
+ my $tag = uc($1);
+ my $type = (lc($tag) eq 'input'?
+ $token->attributes->{'type'}: undef);
+ my $name = $token->attributes->{'name'};
+ printf OUTPUT "#. %s\n", $tag
+ . (defined $type? " type=$type->[1]": '')
+ . (defined $name? " name=$name->[1]": '');
+ }
+ }