[glibmm/gmmproc-refactor] Extended type fixups a bit.



commit 554bef70aed3662230032cdebf2b5e9ff6decdac
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Mon Jun 11 04:53:04 2012 +0200

    Extended type fixups a bit.

 tools/pm/Common/Shared.pm |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/tools/pm/Common/Shared.pm b/tools/pm/Common/Shared.pm
index 384ac32..cadae47 100644
--- a/tools/pm/Common/Shared.pm
+++ b/tools/pm/Common/Shared.pm
@@ -256,10 +256,12 @@ sub _type_fixup ($)
 {
   my ($type) = @_;
 
+  # 'int * &' -> 'int*&'
   while ($type =~ /\s+[&*]+/)
   {
-    $type =~ s/\s+([*&]+)/$1 /g;
+    $type =~ s/\s+([&*]+)/$1 /g;
   }
+  # vector<int> -> vector< int >
   while ($type =~ /<\S/)
   {
     $type =~ s/<(\S)/< $1/g;
@@ -268,6 +270,25 @@ sub _type_fixup ($)
   {
     $type =~ s/(\S)>/$1 >/g;
   }
+  # std::vector < int >& -> std::vector< int >&
+  while ($type =~ /\w\s+</)
+  {
+    $type =~ s/(\w)\s+</$1</g;
+  }
+  # std :: vector -> std::vector
+  while ($type =~ /\w\s+::/)
+  {
+    $type =~ s/(\w)\s+::/$1::/g;
+  }
+  while ($type =~ /::\s+/)
+  {
+    $type =~ s/::\s+/::/g;
+  }
+  # a< b,c,d > -> a< b, c, d >
+  while ($type =~ /,\S/)
+  {
+    $type =~ s/,(\S)/, $1/g;
+  }
   $type = Common::Util::string_simplify $type;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]