You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2017/04/16 10:50:46 UTC

[2/2] lucy-clownfish git commit: Don't create callbacks for excluded methods

Don't create callbacks for excluded methods

Ideally, there should be a way to only omit the callback function
definition in order to allow custom implementations.


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

Branch: refs/heads/master
Commit: 74c12c7ef8a3a3d66d959c8a3b9f8b30efc61b77
Parents: 0bfeb23
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Fri Mar 24 14:48:46 2017 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Apr 16 12:17:19 2017 +0200

----------------------------------------------------------------------
 compiler/src/CFCBindSpecs.c | 2 +-
 compiler/src/CFCPerl.c      | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/74c12c7e/compiler/src/CFCBindSpecs.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCBindSpecs.c b/compiler/src/CFCBindSpecs.c
index b8c609a..19a03b4 100644
--- a/compiler/src/CFCBindSpecs.c
+++ b/compiler/src/CFCBindSpecs.c
@@ -339,7 +339,7 @@ S_add_novel_meth(CFCBindSpecs *self, CFCMethod *method, CFCClass *klass,
     const char *sep = meth_index == 0 ? "" : ",\n";
 
     char *full_override_sym;
-    if (!CFCMethod_final(method)) {
+    if (!CFCMethod_final(method) && !CFCMethod_excluded_from_host(method)) {
         full_override_sym = CFCMethod_full_override_sym(method, klass);
     }
     else {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/74c12c7e/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerl.c b/compiler/src/CFCPerl.c
index f43bc47..73c8d35 100644
--- a/compiler/src/CFCPerl.c
+++ b/compiler/src/CFCPerl.c
@@ -311,7 +311,9 @@ S_write_host_c(CFCPerl *self, CFCParcel *parcel) {
             CFCMethod *method = fresh_methods[meth_num];
 
             // Define callback.
-            if (CFCMethod_novel(method) && !CFCMethod_final(method)) {
+            if (CFCMethod_novel(method)
+                && !CFCMethod_final(method)
+                && !CFCMethod_excluded_from_host(method)) {
                 char *cb_def = CFCPerlMethod_callback_def(method, klass);
                 cb_defs = CFCUtil_cat(cb_defs, cb_def, "\n", NULL);
                 FREEMEM(cb_def);