aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_output_debugs.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/ao_output_debugs.d')
-rw-r--r--src/sdp/ao_output_debugs.d120
1 files changed, 46 insertions, 74 deletions
diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d
index 35e250c..8b22f28 100644
--- a/src/sdp/ao_output_debugs.d
+++ b/src/sdp/ao_output_debugs.d
@@ -3,14 +3,9 @@
+/
template SiSUoutputDebugs() {
struct SDPoutputDebugs {
- auto abstract_doc_source_debugs(S)(
+ auto abstract_doc_source_debugs(S,T)(
auto ref const S contents,
- string[][string] document_section_keys_sequenced,
- string[] html_segnames,
- string[string][string] dochead_make,
- string[string][string] dochead_meta,
- string fn_src,
- bool[string] opt_action_bool
+ auto ref T doc_matters,
) {
mixin RgxInit;
mixin InternalMarkup;
@@ -24,7 +19,7 @@ template SiSUoutputDebugs() {
__FILE__,
__LINE__,
);
- foreach (key; document_section_keys_sequenced["seg"]) {
+ foreach (key; doc_matters.keys_seq_seg) {
foreach (obj; contents[key]) {
if (obj.use != "empty") {
if (obj.is_a == "heading") {
@@ -58,16 +53,15 @@ template SiSUoutputDebugs() {
}
}
}
- void out_segnames(S)(
+ void out_segnames(S,T)(
auto ref const S contents,
- string[] keys,
- string[] html_segnames,
+ auto ref T doc_matters,
) {
- foreach (key; keys) {
+ foreach (key; doc_matters.keys_seq_seg) {
if (contents[key].length > 1) {
foreach (obj; contents[key]) {
if (obj.heading_lev_markup == 4) {
- writeln(obj.ptr_html_segnames, ". (", html_segnames[obj.ptr_html_segnames], ") -> ", obj.text);
+ writeln(obj.ptr_html_segnames, ". (", doc_matters.segnames[obj.ptr_html_segnames], ") -> ", obj.text);
}
}
}
@@ -144,26 +138,8 @@ template SiSUoutputDebugs() {
out_toc(contents, key);
}
debug(segnames) {
- key="toc_scroll";
writeln(__LINE__);
- string[] keys;
- keys ~= [ "toc_seg", "body" ];
- if (contents["endnotes_seg"].length > 1) {
- keys ~= "endnotes_seg";
- }
- if (contents["glossary"].length > 1) {
- keys ~= "glossary";
- }
- if (contents["bibliography"].length > 1) {
- keys ~= "bibliography";
- }
- if (contents["bookindex_seg"].length > 1) {
- keys ~= "bookindex_seg";
- }
- if (contents["blurb"].length > 1) {
- keys ~= "blurb";
- }
- out_segnames(contents, keys, html_segnames);
+ out_segnames(contents, doc_matters);
}
debug(section_body) {
key="body";
@@ -180,7 +156,7 @@ template SiSUoutputDebugs() {
}
debug(dom) {
enum DomTags { none, open, close, close_and_open, open_still, }
- foreach (sect; document_section_keys_sequenced["seg"]) {
+ foreach (sect; doc_matters.keys_seq_seg) {
foreach (obj; contents[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (k; 0 .. 7) {
@@ -203,7 +179,7 @@ template SiSUoutputDebugs() {
}
}
writeln("--------------------");
- foreach (sect; document_section_keys_sequenced["seg"]) {
+ foreach (sect; doc_matters.keys_seq_seg) {
foreach (obj; contents[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (k; 0 .. 7) {
@@ -227,15 +203,11 @@ template SiSUoutputDebugs() {
}
}
debug(section_endnotes) {
- key="endnotes_seg";
+ key="endnotes";
out_endnotes(contents, key);
}
debug(section_endnotes_seg) {
- key="endnotes_seg";
- out_endnotes(contents, key);
- }
- debug(section_endnotes_scroll) {
- key="endnotes_scroll";
+ key="endnotes";
out_endnotes(contents, key);
}
debug(section_glossary) {
@@ -311,19 +283,19 @@ template SiSUoutputDebugs() {
writefln(
"%s\n%s\n%s",
"document header, metadata & make instructions:",
- dochead_meta,
+ doc_matters.dochead_meta,
ptr_head_main,
);
foreach (main_header; ptr_head_main) {
switch (main_header) {
case "make":
foreach (sub_header; ptr_head_sub_make) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
@@ -337,115 +309,115 @@ template SiSUoutputDebugs() {
writefln(
"%s\n%s\n%s",
"document header, metadata & make instructions:",
- dochead_meta,
+ doc_matters.dochead_meta,
ptr_head_main,
);
foreach (main_header; ptr_head_main) {
switch (main_header) {
case "creator":
foreach (sub_header; ptr_head_sub_creator) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "title":
foreach (sub_header; ptr_head_sub_title) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "rights":
foreach (sub_header; ptr_head_sub_rights) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "date":
foreach (sub_header; ptr_head_sub_date) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "original":
foreach (sub_header; ptr_head_sub_original) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "classify":
foreach (sub_header; ptr_head_sub_classify) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "identifier":
foreach (sub_header; ptr_head_sub_identifier) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "notes":
foreach (sub_header; ptr_head_sub_notes) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
break;
case "publisher":
foreach (sub_header; ptr_head_sub_publisher) {
- if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ if (to!string(doc_matters.dochead_meta[main_header][sub_header]).length > 2) {
writefln(
"%s:%s: %s",
main_header,
sub_header,
- dochead_meta[main_header][sub_header]
+ doc_matters.dochead_meta[main_header][sub_header]
);
}
}
@@ -462,7 +434,7 @@ template SiSUoutputDebugs() {
__FILE__,
__LINE__,
);
- foreach (k; document_section_keys_sequenced["seg"]) {
+ foreach (k; doc_matters.keys_seq_seg) {
foreach (obj; contents[k]) {
if (obj.is_a == "heading") {
writefln(
@@ -478,7 +450,7 @@ template SiSUoutputDebugs() {
}
}
debug(heading) { // heading
- foreach (k; document_section_keys_sequenced["seg"]) {
+ foreach (k; doc_matters.keys_seq_seg) {
foreach (o; contents[k]) {
if (o.is_a == "heading") {
writefln(
@@ -503,7 +475,7 @@ template SiSUoutputDebugs() {
__FILE__,
__LINE__,
);
- foreach (k; document_section_keys_sequenced["seg"]) {
+ foreach (k; doc_matters.keys_seq_seg) {
foreach (obj; contents[k]) {
if (obj.is_a == "heading") {
writefln(
@@ -518,7 +490,7 @@ template SiSUoutputDebugs() {
}
}
debug(checkdoc) {
- foreach (k; document_section_keys_sequenced["seg"]) {
+ foreach (k; doc_matters.keys_seq_seg) {
foreach (obj; contents[k]) {
if (obj.use != "empty") {
if (!empty(obj.obj_cite_number)) {
@@ -531,9 +503,9 @@ template SiSUoutputDebugs() {
writefln(
"%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,
+ doc_matters.dochead_meta["title"]["full"],
+ doc_matters.dochead_meta["creator"]["author"],
+ doc_matters.source_filename,
"---------------------------------",
"length toc array: ",
to!int(contents["toc_seg"].length),
@@ -542,8 +514,8 @@ template SiSUoutputDebugs() {
"last obj_cite_number: ",
to!int(check["last_obj_cite_number"]),
"length endnotes: ",
- (contents["endnotes_seg"].length > 1)
- ? (to!int(contents["endnotes_seg"].length))
+ (contents["endnotes"].length > 1)
+ ? (to!int(contents["endnotes"].length))
: 0,
"length glossary: ",
(contents["glossary"].length > 1)
@@ -565,8 +537,8 @@ template SiSUoutputDebugs() {
__LINE__,
);
debug(checkdoc) {
- if (auto mfn=match(fn_src, rgx.src_fn)) {
- if (opt_action_bool["assertions"]) {
+ if (auto mfn=match(doc_matters.source_filename, rgx.src_fn)) {
+ if (doc_matters.opt_action_bool["assertions"]) {
switch (mfn.captures[2]) {
// live manual:
case "live-manual.ssm":
@@ -685,7 +657,7 @@ template SiSUoutputDebugs() {
// error in bookindex ... (ch7 ... building the cc machine, an extra semi colon)
break;
default:
- writeln(fn_src);
+ writeln(doc_matters.source_filename);
break;
}
}