Replace "Err_get_error" with "Clownfish->error" in POD


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

Branch: refs/heads/markdown_v2
Commit: b6de550ac6e248d1a4662c74aaa23b8e8595b31b
Parents: 65b4c9b
Author: Nick Wellnhofer <[email protected]>
Authored: Tue Dec 23 22:11:53 2014 +0100
Committer: Nick Wellnhofer <[email protected]>
Committed: Tue Dec 23 22:11:53 2014 +0100

----------------------------------------------------------------------
 compiler/src/CFCPerlPod.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b6de550a/compiler/src/CFCPerlPod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerlPod.c b/compiler/src/CFCPerlPod.c
index 4ba5f9d..08d8bda 100644
--- a/compiler/src/CFCPerlPod.c
+++ b/compiler/src/CFCPerlPod.c
@@ -614,6 +614,16 @@ S_convert_link(CFCClass *klass, cmark_node *link) {
         case CFC_URI_FUNCTION:
         case CFC_URI_METHOD: {
             const char *full_struct_sym = CFCUri_full_struct_sym(uri_obj);
+            const char *func_sym        = CFCUri_get_func_sym(uri_obj);
+
+            // Convert "Err_get_error" to "Clownfish->error".
+            if (strcmp(full_struct_sym, "cfish_Err") == 0
+                && strcmp(func_sym, "get_error") == 0
+            ) {
+                new_text = CFCUtil_strdup("Clownfish->error");
+                break;
+            }
+
             CFCClass *uri_class
                 = CFCClass_fetch_by_struct_sym(full_struct_sym);
 
@@ -629,7 +639,6 @@ S_convert_link(CFCClass *klass, cmark_node *link) {
                 new_uri = CFCUtil_strdup(class_name);
             }
 
-            const char *func_sym  = CFCUri_get_func_sym(uri_obj);
             new_text = CFCUtil_sprintf("%s()", func_sym);
             for (size_t i = 0; new_text[i] != '\0'; ++i) {
                 new_text[i] = tolower(new_text[i]);

Reply via email to