lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [1/3] git commit: Fix DocuComment extraction from C headers
Date Sun, 06 Jul 2014 21:40:56 GMT
Repository: lucy-clownfish
Updated Branches:
  refs/heads/cfc-pod-wip2 273ce8f8a -> 19dd70ee1


Fix DocuComment extraction from C headers


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/75388f0b
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/75388f0b
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/75388f0b

Branch: refs/heads/cfc-pod-wip2
Commit: 75388f0b61f22b2a8da46160498c42d4fdadc880
Parents: 273ce8f
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Jul 6 23:32:07 2014 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sun Jul 6 23:32:07 2014 +0200

----------------------------------------------------------------------
 compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/75388f0b/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm b/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
index f12b543..93643e7 100644
--- a/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
+++ b/compiler/perl/buildlib/Clownfish/CFC/Build/Binding.pm
@@ -266,7 +266,17 @@ sub class_from_c {
             $class->add_method($method);
         }
         else {
-            $name = 'init' if $name eq 'new';
+            if ($name eq 'new') {
+                $name = 'init';
+
+                # Add 'self' parameter.
+                if ($c_params =~ /^\(\s*\)$/) {
+                    $c_params = "($cfc_class_name *self)";
+                }
+                else {
+                    $c_params =~ s/^\(/($cfc_class_name *self, /;
+                }
+            }
 
             my $param_list = $parser->parse($c_params)
                 or die("Invalid param list: $c_params");


Mime
View raw message