Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #240 from pdl/pr-type-error
Fix type check failing (gh #227)
  • Loading branch information
zoffixznet committed Dec 13, 2015
2 parents 68a913a + b45a10e commit 592e4a5
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions htmlify.p6
Expand Up @@ -202,10 +202,10 @@ sub process-pod-source(:$kind, :$pod, :$filename, :$pod-is-complete) {
my %type-info;
if $kind eq "type" {
if $type-graph.types{$name} -> $type {
%type-info = :subkinds($type.packagetype), :categories($type.categories);
%type-info := :{ :subkinds($type.packagetype), :categories($type.categories) };
}
else {
%type-info = :subkinds<class>;
%type-info := :{ :subkinds<class> };
}
}
my $origin = $*DR.add-new(
Expand Down Expand Up @@ -367,7 +367,7 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
# Is this new header a definition?
# If so, begin processing it.
# If not, skip to the next heading.

my @header;
try {
@header := $pod-element.contents[0].contents;
Expand Down Expand Up @@ -414,12 +414,16 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
my %attr;
given $subkinds {
when / ^ [in | pre | post | circum | postcircum ] fix | listop / {
%attr = :kind<routine>,
:categories<operator>,
%attr := :{
:kind<routine>,
:categories<operator>,
};
}
when 'sub'|'method'|'term'|'routine'|'trait' {
%attr = :kind<routine>,
:categories($subkinds),
%attr := :{
:kind<routine>,
:categories($subkinds),
};
}
when 'class'|'role'|'enum' {
my $summary = '';
Expand All @@ -429,19 +433,25 @@ sub find-definitions (:$pod, :$origin, :$min-level = -1, :$url) {
else {
note "$name does not have an =SUBTITLE";
}
%attr = :kind<type>,
:categories($type-graph.types{$name}.?categories//''),
:$summary,
%attr := :{
:kind<type>,
:categories($type-graph.types{$name}.?categories//''),
:$summary,
};
}
when 'variable'|'sigil'|'twigil'|'declarator'|'quote' {
# TODO: More types of syntactic features
%attr = :kind<syntax>,
:categories($subkinds),
%attr := :{
:kind<syntax>,
:categories($subkinds),
};
}
when $unambiguous {
# Index anything from an X<>
%attr = :kind<syntax>,
:categories($subkinds),
%attr := :{
:kind<syntax>,
:categories($subkinds),
};
}
default {
# No clue, probably not meant to be indexed
Expand Down

0 comments on commit 592e4a5

Please sign in to comment.