aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sdp/ao_abstract_doc_source.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-04-24 22:50:48 -0400
committerRalph Amissah <ralph@amissah.com>2016-04-25 22:59:38 -0400
commitd90d65ba5b5c2c0854a328a0560b207453389477 (patch)
treead14a2553e5ea0c4ecd6fbe4133fa63fa47ae4f3 /lib/sdp/ao_abstract_doc_source.d
parentstep2 (diff)
step3
Diffstat (limited to 'lib/sdp/ao_abstract_doc_source.d')
-rw-r--r--lib/sdp/ao_abstract_doc_source.d75
1 files changed, 29 insertions, 46 deletions
diff --git a/lib/sdp/ao_abstract_doc_source.d b/lib/sdp/ao_abstract_doc_source.d
index 74d1baa..00cff5c 100644
--- a/lib/sdp/ao_abstract_doc_source.d
+++ b/lib/sdp/ao_abstract_doc_source.d
@@ -25,7 +25,8 @@ template SiSUdocAbstraction() {
/+ initialize +/
auto rgx = Rgx();
- string[string][] contents_the_objects;
+ ObjComposite[] contents_the_objects;
+
string[string] an_object, processing;
auto set_abstract_object = ObjectAbstractSet();
auto set_header = HeaderDocMetadataMakeJson();
@@ -212,7 +213,8 @@ template SiSUdocAbstraction() {
}
scope(failure) {
stderr.writefln(
- "%s:%s failed here:\n line: %s",
+ "%s\n%s\n%s:%s failed here:\n line: %s",
+ __MODULE__, __FUNCTION__,
__FILE__, __LINE__,
line,
);
@@ -458,12 +460,11 @@ template SiSUdocAbstraction() {
++heading_pointer;
contents_the_objects ~=
set_abstract_object.contents_heading(
- type["obj_cite_number_status"],
an_object["substantive"],
an_object["attrib"],
- obj_cite_number, an_object["lev"],
- an_object["lev_markup_number"],
- an_object["lev_collapsed_number"]
+ obj_cite_number,
+ to!int(an_object["lev_markup_number"]),
+ to!int(an_object["lev_collapsed_number"])
);
// track previous heading and make assertions
debug(objectrelated1) { // check
@@ -534,10 +535,10 @@ template SiSUdocAbstraction() {
} // close else for line empty
} // close else for not the above
} // close after non code, other blocks or regular text
- if (((contents_the_objects[$-1]["is"] == "para")
- || (contents_the_objects[$-1]["is"] == "heading"))
+ if (((contents_the_objects[$-1].is_a == "para")
+ || (contents_the_objects[$-1].is_a == "heading"))
&& (counter-1 > previous_count)) {
- if (match(contents_the_objects[$-1]["obj"],
+ if (match(contents_the_objects[$-1].object,
rgx.inline_notes_delimiter_al_regular_number_note)) {
// endnotes/ footnotes for
// doc objects other than paragraphs & headings
@@ -1408,7 +1409,7 @@ template SiSUdocAbstraction() {
auto block_flag_line_empty(
char[] line,
ref string[string] an_object,
- ref string[string][] contents_the_objects,
+ ref ObjComposite[] contents_the_objects,
ref string[][string][string] bookindex_unordered_hashes,
ref int obj_cite_number,
ref string node,
@@ -2948,7 +2949,6 @@ template SiSUdocAbstraction() {
}
}
struct BookIndexReportSection {
- mixin ObjectSetter;
int mkn, skn;
auto rgx = Rgx();
auto bookindex_write_section(
@@ -2982,7 +2982,6 @@ template SiSUdocAbstraction() {
int obj_cite_number
) {
string type;
- int type_heading;
string lev, lev_markup_number, lev_collapsed_number;
string attrib;
string[string] indent;
@@ -2990,43 +2989,35 @@ template SiSUdocAbstraction() {
auto mainkeys =
bookindex_unordered_hashes.byKey.array.sort().release;
string bi_tmp;
- string[string][] bookindex_section;
+ ObjComposite[] bookindex_section;
// writeln(mainkeys.length);
// B~ Book Index
- type_heading=1;
- bi_tmp = "Book Index";
attrib="";
lev="B";
lev_markup_number="1";
lev_collapsed_number="1";
bookindex_section ~=
set_abstract_object.contents_heading(
- type_heading,
- bi_tmp,
+ "Book Index",
attrib,
obj_cite_number,
- lev,
- lev_markup_number,
- lev_collapsed_number
+ to!int(lev_markup_number),
+ to!int(lev_collapsed_number)
);
++obj_cite_number;
++mkn;
// 1~ Index
- type_heading=1;
- bi_tmp = "Index";
attrib="";
lev="1";
lev_markup_number="4";
lev_collapsed_number="2";
bookindex_section ~=
set_abstract_object.contents_heading(
- type_heading,
- bi_tmp,
+ "Index",
attrib,
obj_cite_number,
- lev,
- lev_markup_number,
- lev_collapsed_number
+ to!int(lev_markup_number),
+ to!int(lev_collapsed_number)
);
++obj_cite_number;
++mkn;
@@ -3115,31 +3106,30 @@ template SiSUdocAbstraction() {
}
}
struct NotesSection {
- mixin ObjectSetter;
string object_notes;
long previous_count;
int mkn;
auto rgx = Rgx();
private auto gather_notes_for_endnote_section(
- string[string][] contents_am,
- long counter
+ ObjComposite[] contents_am,
+ ulong counter
)
in {
// endnotes/ footnotes for
// doc objects other than paragraphs & headings
// various forms of grouped text
- assert((contents_am[counter]["is"] == "para")
- || (contents_am[counter]["is"] == "heading"));
+ assert((contents_am[counter].is_a == "para")
+ || (contents_am[counter].is_a == "heading"));
assert(counter > previous_count);
previous_count=counter;
assert(
- match(contents_am[counter]["obj"],
+ match(contents_am[counter].object,
rgx.inline_notes_delimiter_al_regular_number_note)
);
}
body {
foreach(m;
- matchAll(contents_am[counter]["obj"],
+ matchAll(contents_am[counter].object,
rgx.inline_notes_delimiter_al_regular_number_note)) {
debug(endnotes_build) {
writeln(
@@ -3168,47 +3158,40 @@ template SiSUdocAbstraction() {
}
body {
auto set_abstract_object = ObjectAbstractSet();
- string[string][] endnotes_section;
+ ObjComposite[] endnotes_section;
auto endnotes_ = gathered_notes();
// auto endnotes_ = (split(object_notes, rgx.break_string))[0..$-1];
string type;
- int type_heading;
string lev, lev_markup_number, lev_collapsed_number;
string attrib;
string[string] indent;
// B~ Endnotes
- type_heading=1;
attrib="";
lev="B";
lev_markup_number="1";
lev_collapsed_number="1";
endnotes_section ~=
set_abstract_object.contents_heading(
- type_heading,
"Endnotes",
attrib,
obj_cite_number,
- lev,
- lev_markup_number,
- lev_collapsed_number
+ to!int(lev_markup_number),
+ to!int(lev_collapsed_number)
);
++obj_cite_number;
++mkn;
// 1~ Endnotes
- type_heading=1;
attrib="";
lev="1";
lev_markup_number="4";
lev_collapsed_number="2";
endnotes_section ~=
set_abstract_object.contents_heading(
- type_heading,
"Endnotes",
attrib,
obj_cite_number,
- lev,
- lev_markup_number,
- lev_collapsed_number
+ to!int(lev_markup_number),
+ to!int(lev_collapsed_number)
);
++obj_cite_number;
++mkn;