X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/325da7e90ea83a856317d84934141a5313716194..v1.13-84-g7d20f0f116:/perl.plp
diff --git a/perl.plp b/perl.plp
index 57a7dc8..de4637d 100644
--- a/perl.plp
+++ b/perl.plp
@@ -85,31 +85,7 @@ for my $vernum (reverse sort keys %{$info}) {
say '
';
for (@{ $verrow->{new} }) {
my ($topic, $desc, $attr) = @{$_};
- if ($attr) {
- my $title;
- if (defined $attr->{experimental}) {
- $title = 'experimental';
- }
- if ($attr->{dropped}) {
- next unless exists $get{v};
- $title = sprintf 'removed in %vd', $attr->{dropped};
- }
- elsif ($attr->{stable}) {
- $title .= sprintf ' until %vd', $attr->{stable};
- }
- if ($attr->{experimental}) {
- $title = sprintf '%s',
- $attr->{experimental}, $title;
- $attr->{name} //= $attr->{experimental};
- }
- if ($attr->{feature}) {
- my $prefix = sprintf 'feature',
- $attr->{feature};
- $title = join ', ', $prefix, $title // ();
- $attr->{name} //= $attr->{feature};
- }
- $desc .= sprintf ' (%s)', $title if $title;
- }
+ $desc .= featattrs($attr);
my $ref = defined $attr->{name} && sprintf ' id="%s"', $attr->{name};
say sprintf '- %s
- %s', $ref, $topic, $desc || '
';
}
@@ -127,3 +103,29 @@ for my $vernum (reverse sort keys %{$info}) {
say "\n";
}
+sub featattrs ($attr) {
+ my $title;
+ if (defined $attr->{experimental}) {
+ $title = 'experimental';
+ }
+ if ($attr->{dropped}) {
+ next unless exists $get{v};
+ $title = sprintf 'removed in %vd', $attr->{dropped};
+ }
+ elsif ($attr->{stable}) {
+ $title .= sprintf ' until %vd', $attr->{stable};
+ }
+ if ($attr->{experimental}) {
+ $title = sprintf '%s',
+ $attr->{experimental}, $title;
+ $attr->{name} //= $attr->{experimental};
+ }
+ if ($attr->{feature}) {
+ my $prefix = sprintf 'feature',
+ $attr->{feature};
+ $title = join ', ', $prefix, $title // ();
+ $attr->{name} //= $attr->{feature};
+ }
+ return sprintf ' (%s)', $title if $title;
+ return '';
+}