Skip to content

Commit

Permalink
preparing for removal of extra ""
Browse files Browse the repository at this point in the history
Putting some redundant when statements to catch the new .contents
format when that happens
  • Loading branch information
LLFourn committed Dec 24, 2015
1 parent cc397c0 commit eafa0de
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion htmlify.p6
Expand Up @@ -377,6 +377,15 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
my @definitions; # [subkind, name]
my $unambiguous = False;
given @header {
when :(Pod::FormattingCode $) {
my $fc := .[0];
proceed unless $fc.type eq "X";
@definitions = $fc.meta[0].flat;
# set default name if none provide so X<if|control> gets name 'if'
@definitions[1] = $fc.contents[0] if @definitions == 1;
$unambiguous = True;
}
# XXX: Remove when extra "" have been purged
when :("", Pod::FormattingCode $, "") {
my $fc := .[1];
proceed unless $fc.type eq "X";
Expand All @@ -401,10 +410,14 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
# The C<Foo> infix
@definitions = .[2].words[0], .[1].contents[0];
}
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $, "") {
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $) {
# infix C<Foo>
@definitions = .[0].words[0], .[1].contents[0];
}
# XXX: Remove when extra "" have been purged
when :(Str $ where /^(\w+) \s$/, Pod::FormattingCode $, "") {
@definitions = .[0].words[0], .[1].contents[0];
}
default { next }
}

Expand Down

0 comments on commit eafa0de

Please sign in to comment.