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 2013/06/15 23:42:35 UTC

[lucy-commits] [12/14] git commit: refs/heads/master - Use host aliases and excludes from other parcels

Use host aliases and excludes from other parcels

If a method is defined in a different parcel, find the novel method in
that parcel and use its host aliases and excludes.


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

Branch: refs/heads/master
Commit: 703d6e2ebc9a5470d84a8f3cf11056e1f7635023
Parents: ccbaad3
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Jun 15 20:30:26 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sat Jun 15 23:34:20 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/src/CFCPerlClass.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/703d6e2e/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
index f11b7d9..05dc585 100644
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ b/clownfish/compiler/src/CFCPerlClass.c
@@ -256,21 +256,30 @@ CFCPerlClass_method_bindings(CFCPerlClass *self) {
     for (size_t i = 0; fresh_methods[i] != NULL; i++) {
         CFCMethod  *method    = fresh_methods[i];
         const char *meth_name = CFCMethod_get_macro_sym(method);
+        CFCMethod  *novel_method;
 
         // Only deal with methods when they are novel (i.e. first declared)
         // or the parent's definition is from an included parcel (i.e. they
         // are first declared in this parcel).
-        if (!CFCMethod_novel(method)) {
+        if (CFCMethod_novel(method)) {
+            novel_method = method;
+        }
+        else {
             CFCMethod *parent_method = CFCClass_method(parent, meth_name);
             CFCParcel *parcel = CFCMethod_get_parcel(parent_method);
             if (!CFCParcel_included(parcel)) { continue; }
+
+            novel_method = CFCClass_find_novel_method(parent, meth_name);
+            if (!novel_method) {
+                CFCUtil_die("Novel method not found");
+            }
         }
 
         // Skip private methods.
         if (CFCSymbol_private((CFCSymbol*)method)) { continue; }
 
         // Skip methods which have been explicitly excluded.
-        if (CFCMethod_excluded_from_host(method)) {
+        if (CFCMethod_excluded_from_host(novel_method)) {
             continue;
         }
 
@@ -282,7 +291,7 @@ CFCPerlClass_method_bindings(CFCPerlClass *self) {
         }
 
         // See if the user wants the method to have a specific alias.
-        const char *alias = CFCMethod_get_host_alias(method);
+        const char *alias = CFCMethod_get_host_alias(novel_method);
         if (!alias) {
             alias = CFCMethod_micro_sym(method);
         }