~ubuntu-branches/ubuntu/saucy/padre/saucy-proposed

« back to all changes in this revision

Viewing changes to lib/Padre/Document/CSharp/FunctionList.pm

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2012-01-04 12:04:20 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20120104120420-i5oybqwf91m1d3il
Tags: 0.92.ds1-1
[ gregor herrmann ]
* Remove debian/source/local-options; abort-on-upstream-changes
  and unapply-patches are default in dpkg-source since 1.16.1.
* Swap order of alternative (build) dependencies after the perl
  5.14 transition.

[ Dominique Dumont ]
* Imported Upstream version 0.92.ds1
* removed fix-spelling patch (applied upstream)
* lintian-override: use wildcard to avoid listing a gazillion files
* updated size of some 'not-real-man-page' entries
* rules: remove dekstop cruft (replaced by a file provided in debian
  directory)
* control: removed Breaks statement. Add /me to uploaders. Updated
  dependencies
* rules: make sure that non-DFSG file (i.e. the cute butterfly, sigh)
  is not distributed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Padre::Document::CSharp::FunctionList;
 
2
 
 
3
use 5.008;
 
4
use strict;
 
5
use warnings;
 
6
use Padre::Task::FunctionList ();
 
7
 
 
8
our $VERSION = '0.92';
 
9
our @ISA     = 'Padre::Task::FunctionList';
 
10
 
 
11
######################################################################
 
12
# Padre::Task::FunctionList Methods
 
13
 
 
14
my $newline =
 
15
        qr{\cM?\cJ}; # recognize newline even if encoding is not the platform default (will not work for MacOS classic)
 
16
my $method_search_regex = qr{
 
17
                        /\*.+?\*/        # block comment
 
18
                        |
 
19
                        \/\/.+?$newline  # line comment
 
20
                        |
 
21
                        (?:^|$newline)   # text start or newline 
 
22
                        \s*              
 
23
                        (?:
 
24
                          (?: \[ [\s\w()]+ \]\s* )?  # optional annotations
 
25
                          (?:
 
26
                                (?: public|protected|private|
 
27
                                    abstract|static|sealed|virtual|override|
 
28
                                    explicit|implicit|
 
29
                                    operator|
 
30
                                    extern)
 
31
                                \s+
 
32
                          ){0,4}                     # zero to 2 method modifiers
 
33
                          (?: [\w\[\]<>,]+)          # return data type
 
34
                          \s+
 
35
                          (\w+)                      # method name
 
36
                          (?: <\w+>)?                # optional: generic type parameter
 
37
                          \s*
 
38
                          \(.*?\)                    # parentheses around the parameters
 
39
                        )
 
40
        }sx;
 
41
 
 
42
sub find {
 
43
        return grep { defined $_ } $_[1] =~ /$method_search_regex/g;
 
44
}
 
45
 
 
46
1;
 
47
 
 
48
# Copyright 2008-2011 The Padre development team as listed in Padre.pm.
 
49
# LICENSE
 
50
# This program is free software; you can redistribute it and/or
 
51
# modify it under the same terms as Perl 5 itself.