The previous attempt to properly handle literal blocks broke parsing of parameter lines containing colons; fix it by tweaking the regex to specifically exclude the "::" pattern while accepting lines containing colons in general. Add a little documentation to the regex while in the neighborhood.
Unified · Split
| @@ -391,8 +391,14 @@ my $doc_com = '\s*\*\s*'; · 390 unmodified lines | ||
| 391 | 391 | my $doc_com_body = '\s*\* ?'; |
| 392 | 392 | my $doc_decl = $doc_com . '(\w+)'; |
| 393 | 393 | # @params and a strictly limited set of supported section names |
| 394 | +# Specifically: | |
| 395 | +# Match @word: | |
| 396 | +# @...: | |
| 397 | +# @{section-name}: | |
| 398 | +# while trying to not match literal block starts like "example::" | |
| 399 | +# | |
| 394 | 400 | my $doc_sect = $doc_com . |
| 395 | − '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:]*)$'; | |
| 401 | + '\s*(\@[.\w]+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:([^:].*)?$'; | |
| 396 | 402 | my $doc_content = $doc_com_body . '(.*)'; |
| 397 | 403 | my $doc_block = $doc_com . 'DOC:\s*(.*)?'; |
| 398 | 404 | my $doc_inline_start = '^\s*/\*\*\s*$'; |