Created
October 27, 2010 17:41
-
-
Save pcapriotti/649556 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ba220db019793794ed068a4c1441eecee330ea65 Mon Sep 17 00:00:00 2001 | |
From: Paolo Capriotti <[email protected]> | |
Date: Wed, 27 Oct 2010 18:32:26 +0100 | |
Subject: [PATCH] Simplify function regexp and fix bug for pointer and reference return types. | |
--- | |
vim-protodef/pullproto.pl | 10 +++++----- | |
1 files changed, 5 insertions(+), 5 deletions(-) | |
diff --git a/vim-protodef/pullproto.pl b/vim-protodef/pullproto.pl | |
index f38fab5..03d4785 100644 | |
--- a/vim-protodef/pullproto.pl | |
+++ b/vim-protodef/pullproto.pl | |
@@ -77,11 +77,11 @@ while (<STDIN>) | |
} | |
else | |
{ | |
- my @a = $content =~ m/(const)?\s*(unsigned)?\s*(\S+)\s*(\Q$function\E$matched?)\s*(\([^\)]*\)[^;]*);/m; # (Matt Spear) added \Q\E and $matched | |
- my $str = join(" ", @a); | |
- ($pre, $fname, $post) = $str =~ m/(.*\s)(\Q$function\E$matched?)\s(.*)/s; # (Matt Spear) added \Q\E and $matched | |
- $pre =~ s/\s+/ /g; | |
- $pre =~ s/^\s+//g; | |
+ my @a = $content =~ m/((const)?\s*(unsigned)?\s*\S+\s*[\*&]?)(\Q$function\E$matched?)\s*(\([^\)]*\)[^;]*);/m; # (Matt Spear) added \Q\E and $matched | |
+ | |
+ $pre = @a[0]; | |
+ $fname = @a[3]; | |
+ $post = @a[4]; | |
} | |
print "==\n"; | |
if ($class ne "") | |
-- | |
1.7.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment