lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [2/2] git commit: refs/heads/cfc-pod - Omit empty description sections in pod
Date Tue, 30 Jul 2013 10:02:26 GMT
Omit empty description sections in pod


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

Branch: refs/heads/cfc-pod
Commit: 58f9153df61f17a711bb60621c2c8304124e8770
Parents: 31524da
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Tue Jul 30 11:50:12 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Tue Jul 30 12:01:45 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/src/CFCPerlClass.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/58f9153d/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
index 6e9d48b..6cc6724 100644
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ b/clownfish/compiler/src/CFCPerlClass.c
@@ -409,13 +409,6 @@ CFCPerlClass_create_pod(CFCPerlClass *self) {
     const char *raw_brief = CFCDocuComment_get_brief(docucom);
     char *brief = CFCPerlPod_perlify_doc_text(pod_spec, raw_brief);
 
-    // Get the class's long description.
-    const char *raw_description = CFCPerlPod_get_description(pod_spec);
-    if (!raw_description || !strlen(raw_description)) {
-        raw_description = CFCDocuComment_get_long(docucom);
-    }
-    char *description = CFCPerlPod_perlify_doc_text(pod_spec, raw_description);
-
     // Create SYNOPSIS.
     const char *raw_synopsis = CFCPerlPod_get_synopsis(pod_spec);
     char *synopsis = CFCUtil_strdup("");
@@ -424,6 +417,20 @@ CFCPerlClass_create_pod(CFCPerlClass *self) {
                                "\n", NULL);
     }
 
+    // Create DESCRIPTION.
+    const char *raw_description = CFCPerlPod_get_description(pod_spec);
+    if (!raw_description || !strlen(raw_description)) {
+        raw_description = CFCDocuComment_get_long(docucom);
+    }
+    char *description = CFCUtil_strdup("");
+    if (raw_description && strlen(raw_description)) {
+        char *desc_text
+            = CFCPerlPod_perlify_doc_text(pod_spec, raw_description);
+        description = CFCUtil_cat(description, "=head1 DESCRIPTION\n\n",
+                                  desc_text, "\n", NULL);
+        FREEMEM(desc_text);
+    }
+
     // Create CONSTRUCTORS.
     char *constructor_pod = CFCPerlPod_constructors_pod(pod_spec, client);
 
@@ -475,8 +482,6 @@ CFCPerlClass_create_pod(CFCPerlClass *self) {
     "\n"
     "%s\n"
     "\n"
-    "=head1 DESCRIPTION\n"
-    "\n"
     "%s\n"
     "\n"
     "%s\n"


Mime
View raw message