Skip to content

Commit f17ca34

Browse files
committed
First humble attempts to parallelize htmlify
currently dies with: Internal Error: Unwound entire stack and missed handler
1 parent cd56de3 commit f17ca34

File tree

1 file changed

+41
-36
lines changed

1 file changed

+41
-36
lines changed

htmlify.p6

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -554,46 +554,51 @@ sub write-search-file () {
554554
spurt("html/js/search.js", $template.subst("ITEMS", $items));
555555
}
556556

557-
sub write-disambiguation-files () {
558-
say 'Writing disambiguation files ...';
559-
for $*DR.grouped-by('name').kv -> $name, $p is copy {
560-
print '.';
561-
my $pod = pod-with-title("Disambiguation for '$name'");
562-
if $p.elems == 1 {
563-
$p = $p[0] if $p ~~ Array;
564-
if $p.origin -> $o {
565-
$pod.contents.push:
566-
pod-block(
567-
pod-link("'$name' is a $p.human-kind()", $p.url),
568-
' from ',
569-
pod-link($o.human-kind() ~ ' ' ~ $o.name, $o.url),
570-
);
571-
}
572-
else {
573-
$pod.contents.push:
574-
pod-block(
575-
pod-link("'$name' is a $p.human-kind()", $p.url)
576-
);
577-
}
557+
sub write-single-disambiguation-file($name, $p is copy) {
558+
my $pod = pod-with-title("Disambiguation for '$name'");
559+
if $p.elems == 1 {
560+
$p = $p[0] if $p ~~ Array;
561+
if $p.origin -> $o {
562+
$pod.contents.push:
563+
pod-block(
564+
pod-link("'$name' is a $p.human-kind()", $p.url),
565+
' from ',
566+
pod-link($o.human-kind() ~ ' ' ~ $o.name, $o.url),
567+
);
578568
}
579569
else {
580570
$pod.contents.push:
581-
pod-block("'$name' can be anything of the following"),
582-
$p.map({
583-
if .origin -> $o {
584-
pod-item(
585-
pod-link(.human-kind, .url),
586-
' from ',
587-
pod-link($o.human-kind() ~ ' ' ~ $o.name, $o.url),
588-
)
589-
}
590-
else {
591-
pod-item( pod-link(.human-kind, .url) )
592-
}
593-
});
571+
pod-block(
572+
pod-link("'$name' is a $p.human-kind()", $p.url)
573+
);
574+
}
575+
}
576+
else {
577+
$pod.contents.push:
578+
pod-block("'$name' can be anything of the following"),
579+
$p.map({
580+
if .origin -> $o {
581+
pod-item(
582+
pod-link(.human-kind, .url),
583+
' from ',
584+
pod-link($o.human-kind() ~ ' ' ~ $o.name, $o.url),
585+
)
586+
}
587+
else {
588+
pod-item( pod-link(.human-kind, .url) )
589+
}
590+
});
591+
}
592+
my $html = p2h($pod, 'routine');
593+
spurt "html/$name.subst(/<[/\\]>/,'_',:g).html", $html;
594+
}
595+
596+
sub write-disambiguation-files () {
597+
say 'Writing disambiguation files ...';
598+
await do for $*DR.grouped-by('name').kv -> $name, $p {
599+
start {
600+
write-single-disambiguation-file($name, $p);
594601
}
595-
my $html = p2h($pod, 'routine');
596-
spurt "html/$name.subst(/<[/\\]>/,'_',:g).html", $html;
597602
}
598603
say '';
599604
}

0 commit comments

Comments
 (0)