| 1 | package Parse::Functions::Perl; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Parse::Functions; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | our $VERSION = '0.01'; | |
| 9 | 1 | our @ISA = qw(Parse::Functions); | |
| 10 | |||
| 11 | # TODO: the regex containing func|method should either reuse what | ||
| 12 | # Padre has in PPIx::EditorTools::Outline or copy the list from there | ||
| 13 | # for now let's leave it as it is and focus on improving the Outline | ||
| 14 | # code and then we'll see if we reuse or copy paste. | ||
| 15 | |||
| 16 | 3 | ▶ | sub function_re { |
|
Subroutine
function_re: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 17 | 3 | my ($self) = @_; | |
| 18 | |||
| 19 | 3 | my $newline = $self->newline; | |
| 20 | 3 | return qr{ | |
| 21 | (?: | ||
| 22 | ${newline}__(?:DATA|END)__\b.* | ||
| 23 | | | ||
| 24 | $newline$newline=\w+.*?$newline\s*?$newline=cut\b(?=.*?(?:$newline){1,2}) | ||
| 25 | | | ||
| 26 | (?:^|$newline)\s* | ||
| 27 | (?: | ||
| 28 | (?:sub|func|method|before|after|around|override|augment)\s+(\w+(?:::\w+)*) | ||
| 29 | | | ||
| 30 | \* (\w+(?:::\w+)*) \s*=\s* (?: sub\b | \\\& ) | ||
| 31 | ) | ||
| 32 | ) | ||
| 33 | }sx; | ||
| 34 | } | ||
| 35 | |||
| 36 | 1 | 1; | |
| 37 | |||
| 38 | # Copyright 2008-2014 The Padre development team as listed in Padre.pm. | ||
| 39 | # LICENSE | ||
| 40 | # This program is free software; you can redistribute it and/or | ||
| 41 | # modify it under the same terms as Perl 5 itself. | ||
| 42 | |||