From b7f2764f5e5eb0f3e9fad8e76272756f4219241b Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph@amissah.com>
Date: Wed, 16 Nov 2016 10:08:35 -0500
Subject: minor reorganise same

---
 src/sdp/ao_abstract_doc_source.d | 48 +++++++++++++++++++++++++---------------
 src/sdp/ao_output_debugs.d       | 32 +++++++++++++++++++--------
 2 files changed, 53 insertions(+), 27 deletions(-)

(limited to 'src')

diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d
index f60fa60..851d375 100644
--- a/src/sdp/ao_abstract_doc_source.d
+++ b/src/sdp/ao_abstract_doc_source.d
@@ -2322,30 +2322,15 @@ template SiSUdocAbstraction() {
       string[string] obj_txt;
       int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus;
       string obj_txt_out, tail, note;
+      auto rgx = Rgx();
+      auto mkup = InlineMarkup();
       private auto initialize_note_numbers() {
         n_foot = 0;
         n_foot_reg = 0;
         n_foot_sp_asterisk = 0;
         n_foot_sp_plus = 0;
       }
-      private auto object_notes_(string obj_txt_in)
-      in { }
-      body {
-        auto rgx = Rgx();
-        auto mkup = InlineMarkup();
-        obj_txt_out = "";
-        tail = "";
-        obj_txt_in = replaceAll(
-          obj_txt_in,
-          rgx.inline_notes_curly_sp_asterisk,
-          (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c)
-        );
-        obj_txt_in =
-          replaceAll(
-            obj_txt_in,
-            rgx.inline_notes_curly_sp_plus,
-            (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c)
-          );
+      string url_links(string obj_txt_in) {
         /+ url matched +/
         if (auto m = matchAll(obj_txt_in, rgx.inline_url)) {
           /+ link: naked url: http://url +/
@@ -2388,6 +2373,9 @@ template SiSUdocAbstraction() {
               );
           }
         }
+        return obj_txt_in;
+      }
+      string footnotes_endnotes(string obj_txt_in) {
         /+ endnotes (regular) +/
         obj_txt_in =
           replaceAll(
@@ -2417,6 +2405,30 @@ template SiSUdocAbstraction() {
         } else {
           obj_txt_out = obj_txt_in;
         }
+        return obj_txt_in;
+      }
+      private auto object_notes_(string obj_txt_in)
+      in { }
+      body {
+        obj_txt_out = "";
+        tail = "";
+        /+ special endnotes +/
+        obj_txt_in = replaceAll(
+          obj_txt_in,
+          rgx.inline_notes_curly_sp_asterisk,
+          (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c)
+        );
+        obj_txt_in =
+          replaceAll(
+            obj_txt_in,
+            rgx.inline_notes_curly_sp_plus,
+            (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c)
+          );
+        /+ url matched +/
+        if (auto m = matchAll(obj_txt_in, rgx.inline_url)) {
+          obj_txt_in = url_links(obj_txt_in);
+        }
+        obj_txt_in = footnotes_endnotes(obj_txt_in);
         debug(footnotes) {
           writeln(obj_txt_out, tail);
         }
diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d
index 7764af4..3c3b101 100644
--- a/src/sdp/ao_output_debugs.d
+++ b/src/sdp/ao_output_debugs.d
@@ -522,24 +522,38 @@ template SiSUoutputDebugs() {
           }
         }
         writefln(
-          "%s\n\"%s\", %s\n%s\n%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s:%s\n",
-          "-------------------------------",
+          "%s\n\"%s\", %s\n%s\n%s\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n(%s: %s)",
+          "---------------------------------",
           dochead_meta["title"]["full"],
           dochead_meta["creator"]["author"],
-          "-------------------------------",
           fn_src,
+          "---------------------------------",
+          "length toc array:      ",
+          to!int(contents["toc_seg"].length),
           "length contents array: ",
-          contents["body"].length,
+          to!int(contents["body"].length),
           "last obj_cite_number:  ",
-          check["last_obj_cite_number"],
+          to!int(check["last_obj_cite_number"]),
+          "length endnotes:       ",
+          (contents["endnotes_seg"].length > 1)
+          ? (to!int(contents["endnotes_seg"].length))
+          : 0,
           "length glossary:       ",
-          contents["glossary"].length,
+          (contents["glossary"].length > 1)
+          ? (to!int(contents["glossary"].length))
+          : 0,
           "length biblio:         ",
-          contents["bibliography"].length,
+          (contents["bibliography"].length > 1)
+          ? (to!int(contents["bibliography"].length))
+          : 0,
           "length bookindex:      ",
-          contents["bookindex_seg"].length,
+          (contents["bookindex_seg"].length > 1)
+          ? (to!int(contents["bookindex_seg"].length))
+          : 0,
           "length blurb:          ",
-          contents["blurb"].length,
+          (contents["blurb"].length > 1)
+          ? (to!int(contents["blurb"].length))
+          : 0,
           __FILE__,
           __LINE__,
         );
-- 
cgit v1.2.3