@@ -110,7 +110,7 @@ (Bool :$debug, Bool :$typegraph = False)
110
110
my $ dr = Perl6::Documentable::Registry. new ;
111
111
112
112
say ' Processing Pod files ...' ;
113
- for ( 0 .. * Z @ source ) -> $ num , $ _ {
113
+ for @ source . kv -> $ num , $ _ {
114
114
my $ podname = . key ;
115
115
my $ file = . value ;
116
116
my $ what = $ podname ~~ /^ <[ A..Z ] > | '::' / ?? ' type' !! ' language' ;
@@ -247,37 +247,50 @@ (Bool :$debug, Bool :$typegraph = False)
247
247
for @ chunks -> $ chunk {
248
248
my $ name = $ chunk [0 ]. content[0 ]. content[0 ];
249
249
say " $ podname .$ name" if $ * DEBUG ;
250
- next if $ name ~~ /\s /;
251
250
% methods-by-type {$ podname }. push : $ chunk ;
252
- # determine whether it's a sub or method
253
- my Str $ subkind ;
254
- {
255
- my % counter ;
256
- for first-code-block($ chunk ). lines {
257
- if ms/^ ' multi' ? (sub| method)»/ {
258
- % counter {$0 }++ ;
251
+ # check if it's an operator
252
+ if $ name ~~ /\s / {
253
+ next unless $ name ~~ / ^ [in | pre | post | circum | postcircum ] fix | listop /;
254
+ my $ what = ~ $/ ;
255
+ my $ operator = $ name . split (' ' , 2 )[1 ];
256
+ $ dr . add-new(
257
+ : kind<operator >,
258
+ : subkind($ what ),
259
+ : name($ operator ),
260
+ : pod($ chunk ),
261
+ :! pod-is-complete,
262
+ );
263
+ } else {
264
+ # determine whether it's a sub or method
265
+ my Str $ subkind ;
266
+ {
267
+ my % counter ;
268
+ for first-code-block($ chunk ). lines {
269
+ if ms/^ ' multi' ? (sub| method)»/ {
270
+ % counter {$0 }++ ;
271
+ }
272
+ }
273
+ if % counter == 1 {
274
+ ($ subkind ,) = % counter . keys ;
275
+ }
276
+ if % counter <method > {
277
+ write-qualified-method-call(
278
+ : $ name ,
279
+ : pod($ chunk ),
280
+ : type($ podname ),
281
+ );
259
282
}
260
283
}
261
- if % counter == 1 {
262
- ($ subkind ,) = % counter . keys ;
263
- }
264
- if % counter <method > {
265
- write-qualified-method-call(
266
- : $ name ,
267
- : pod($ chunk ),
268
- : type($ podname ),
269
- );
270
- }
271
- }
272
284
273
- $ dr . add-new(
274
- : kind<routine >,
275
- : $ subkind ,
276
- : $ name ,
277
- : pod($ chunk ),
278
- :! pod-is-complete,
279
- : origin($ d ),
280
- );
285
+ $ dr . add-new(
286
+ : kind<routine >,
287
+ : $ subkind ,
288
+ : $ name ,
289
+ : pod($ chunk ),
290
+ :! pod-is-complete,
291
+ : origin($ d ),
292
+ );
293
+ }
281
294
}
282
295
283
296
spurt " html/$ what /$ podname .html" , p2h($ pod );
0 commit comments