… | |
… | |
105 | $arch->{value} = $e->attr ("value"); |
105 | $arch->{value} = $e->attr ("value"); |
106 | } elsif ($arch->{type} =~ s/^bool_special$/bool/) { |
106 | } elsif ($arch->{type} =~ s/^bool_special$/bool/) { |
107 | $arch->{value} = [$e->attr ("false"), $e->attr ("true")]; |
107 | $arch->{value} = [$e->attr ("false"), $e->attr ("true")]; |
108 | } |
108 | } |
109 | |
109 | |
110 | $sect->{$e->attr ("arch") || $e->attr("arch_begin")} = $arch; |
110 | push @$sect, [$e->attr ("arch") || $e->attr("arch_begin"), $arch]; |
111 | } |
111 | } |
112 | |
112 | |
113 | sub parse_type { |
113 | sub parse_type { |
114 | my ($e, $type) = @_; |
114 | my ($e, $type) = @_; |
115 | |
115 | |
… | |
… | |
119 | if ($e->name eq "required") { |
119 | if ($e->name eq "required") { |
120 | for my $i (grep ref, @{$e->contents}) { |
120 | for my $i (grep ref, @{$e->contents}) { |
121 | $type->{required}{$i->attr ("arch")} = $i->attr ("value"); |
121 | $type->{required}{$i->attr ("arch")} = $i->attr ("value"); |
122 | } |
122 | } |
123 | } elsif ($e->name eq "attribute") { |
123 | } elsif ($e->name eq "attribute") { |
124 | parse_attr $e, $type->{attr} ||= {}; |
124 | parse_attr $e, $type->{attr} ||= []; |
125 | } elsif ($e->name eq "ignore") { |
125 | } elsif ($e->name eq "ignore") { |
126 | for my $i (grep ref, @{$e->contents}) { |
126 | for my $i (grep ref, @{$e->contents}) { |
127 | if ($i->name eq "ignore_list") { |
127 | if ($i->name eq "ignore_list") { |
128 | push @{$type->{ignore}}, $ignore_list{$i->attr ("name")} ||= []; |
128 | push @{$type->{ignore}}, $ignore_list{$i->attr ("name")} ||= []; |
129 | } elsif ($i->name eq "attribute") { |
129 | } elsif ($i->name eq "attribute") { |
… | |
… | |
135 | } elsif ($e->name eq "use") { |
135 | } elsif ($e->name eq "use") { |
136 | $type->{use} = string $e; |
136 | $type->{use} = string $e; |
137 | } elsif ($e->name eq "description") { |
137 | } elsif ($e->name eq "description") { |
138 | $type->{desc} = string $e; |
138 | $type->{desc} = string $e; |
139 | } elsif ($e->name eq "section") { |
139 | } elsif ($e->name eq "section") { |
140 | my %attr; |
140 | my @attr; |
141 | for my $i (grep ref, @{$e->contents}) { |
141 | for my $i (grep ref, @{$e->contents}) { |
142 | parse_attr $i, \%attr; |
142 | parse_attr $i, \@attr; |
143 | } |
143 | } |
144 | push @{ $type->{section} }, [$e->attr ("name") => \%attr]; |
144 | push @{ $type->{section} }, [$e->attr ("name") => \@attr]; |
145 | } else { |
145 | } else { |
146 | warn "unknown types subelement ", $e->name; |
146 | warn "unknown types subelement ", $e->name; |
147 | } |
147 | } |
148 | } |
148 | } |
149 | |
149 | |