@@ -297,12 +297,31 @@ sub find-definitions (:$pod, :$origin, :$dr, :$min-level = -1) {
297
297
# Is this new header a definition?
298
298
# If so, begin processing it.
299
299
# If not, skip to the next heading.
300
- $ i = $ i + 1 and next unless $ c . contents[0 ]. contents[0 ] ~~ Str
301
- and 2 == my @ words = $ c . contents[0 ]. contents[0 ]. words ;
300
+ my $ header := $ c . contents[0 ]. contents;
301
+ my @ words ;
302
+ given $ header {
303
+ when : (Str $ where /^ (\w+ ) \s (\S+ )$/ ) {
304
+ # Infix Foo
305
+ @ words = ~ $0 , ~ $1 ;
306
+ }
307
+ when : (Str $ where /^ The \s (\S+ ) \s (\w+ )$/ ) {
308
+ # The Foo Infix
309
+ @ words = ~ $1 , ~ $0 ;
310
+ }
311
+ when : (Str $ where /^ (\w+ ) \s$/ , Pod ::FormattingCode $ , " " ) {
312
+ # infix C<Foo>
313
+ @ words = ~ $0 , $ header [1 ]. contents[0 ];
314
+ }
315
+ when : (" The " , Pod ::FormattingCode $ , Str $ where /^ \s (\w+ )$/ ) {
316
+ # The C<Foo> infix
317
+ @ words = ~ $0 , $ header [1 ]. contents[0 ];
318
+ }
319
+ default { . perl . say ; $ i = $ i + 1 ; next }
320
+ }
302
321
303
322
my ($ subkinds , $ name ) = @ words ;
304
323
my % attr ;
305
- given $ subkinds {
324
+ given $ subkinds . lc {
306
325
when / ^ [in | pre | post | circum | postcircum ] fix | listop / {
307
326
% attr = : kind<routine >,
308
327
: categories<operator >,
@@ -315,6 +334,10 @@ sub find-definitions (:$pod, :$origin, :$dr, :$min-level = -1) {
315
334
% attr = : kind<type >,
316
335
: categories($ tg . types{$ name }.? categories// ' ' ),
317
336
}
337
+ when ' variable' | ' sigil' | ' twigil' | ' declarator' {
338
+ % attr = : kind<syntax >,
339
+ : categories($ subkinds ),
340
+ }
318
341
default {
319
342
$ i = $ i + 1 and next
320
343
}
0 commit comments