aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-07-20 06:13:50 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitcad1a09a1ed2494947dd35aaf4592fbbee5fbff1 (patch)
tree64da0edd3826ab6d86aa3475ef6162bd9c6bef21 /src/sdp
parentstatic, liberal use of keyword (diff)
naming things
Diffstat (limited to 'src/sdp')
-rw-r--r--src/sdp/meta/defaults.d64
-rw-r--r--src/sdp/meta/metadoc_from_src.d599
2 files changed, 330 insertions, 333 deletions
diff --git a/src/sdp/meta/defaults.d b/src/sdp/meta/defaults.d
index ecc558b..4880f5b 100644
--- a/src/sdp/meta/defaults.d
+++ b/src/sdp/meta/defaults.d
@@ -256,38 +256,38 @@ template SiSUrgxInitFlags() {
/+ regex flags +/
static int[string] flags_type_init() {
int[string] flags_type_init = [
- "make_headings" : 0,
- "header_make" : 0,
- "header_meta" : 0,
- "heading" : 0,
- "biblio_section" : 0,
- "glossary_section" : 0,
- "blurb_section" : 0,
- "para" : 0,
- "blocks" : 0, // 0..2 generic
- "code" : 0, // 0..2
- "poem" : 0, // 0..2
- "table" : 0, // 0..2
- "group" : 0, // 0..2
- "block" : 0, // 0..2
- "quote" : 0, // 0..2
- "verse_new" : 0,
- "curly_code" : 0,
- "curly_poem" : 0,
- "curly_group" : 0,
- "curly_block" : 0,
- "curly_quote" : 0,
- "curly_table" : 0,
- "curly_table_special_markup" : 0,
- "tic_code" : 0,
- "tic_poem" : 0,
- "tic_group" : 0,
- "tic_block" : 0,
- "tic_quote" : 0,
- "tic_table" : 0,
- "ocn_status" : 0, // 0 obj_cite_number; 1 no obj_cite_number; 2 no obj_cite_number & dummy headings
- "ocn_status_multi_obj" : 0, // 0 obj_cite_number; 1 no obj_cite_number; 2 no obj_cite_number & dummy headings
- "book_index" : 0,
+ "make_headings" : 0,
+ "header_make" : 0,
+ "header_meta" : 0,
+ "heading" : 0,
+ "biblio_section" : 0,
+ "glossary_section" : 0,
+ "blurb_section" : 0,
+ "para" : 0,
+ "blocks" : 0, // 0..2 generic
+ "code" : 0, // 0..2
+ "poem" : 0, // 0..2
+ "table" : 0, // 0..2
+ "group" : 0, // 0..2
+ "block" : 0, // 0..2
+ "quote" : 0, // 0..2
+ "verse_new" : 0,
+ "curly_code" : 0,
+ "curly_poem" : 0,
+ "curly_group" : 0,
+ "curly_block" : 0,
+ "curly_quote" : 0,
+ "curly_table" : 0,
+ "curly_table_special_markup" : 0,
+ "tic_code" : 0,
+ "tic_poem" : 0,
+ "tic_group" : 0,
+ "tic_block" : 0,
+ "tic_quote" : 0,
+ "tic_table" : 0,
+ "ocn_status" : 0, // 0 obj_cite_number; 1 no obj_cite_number; 2 no obj_cite_number & dummy headings
+ "ocn_status_off_for_multiple_objects" : 0, // 0 obj_cite_number; 1 no obj_cite_number; 2 no obj_cite_number & dummy headings
+ "book_index" : 0,
];
return flags_type_init;
}
diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d
index ebcfe71..cc6311e 100644
--- a/src/sdp/meta/metadoc_from_src.d
+++ b/src/sdp/meta/metadoc_from_src.d
@@ -266,7 +266,7 @@ template SiSUdocAbstraction() {
"glossary" : 0,
"blurb" : 0,
];
- auto type = flags_type_init;
+ auto obj_type_status = flags_type_init;
string[string] obj_cite_number_poem = [
"start" : "",
"end" : ""
@@ -380,27 +380,27 @@ template SiSUdocAbstraction() {
}
}
if (!line.empty) {
- type = _check_ocn_status_(line, type);
+ obj_type_status = _check_ocn_status_(line, obj_type_status);
}
- if (type["code"] == TriState.on) {
+ if (obj_type_status["code"] == TriState.on) {
/+ block object: code +/
- _code_block_(line, an_object, type);
+ _code_block_(line, an_object, obj_type_status);
continue;
} else if (!matchFirst(line, rgx.skip_from_regular_parse)) {
/+ object other than "code block" object
(includes regular text paragraph, headings & blocks other than code) +/
/+ heading, glossary, blurb, poem, group, block, quote, table +/
if (line.matchFirst(rgx.heading_biblio)
- || (type["biblio_section"] == State.on
+ || (obj_type_status["biblio_section"] == State.on
&& (!(line.matchFirst(rgx.heading_blurb_glossary)))
&& (!(line.matchFirst(rgx.heading)))
&& (!(line.matchFirst(rgx.comment))))) {
/+ within section (block object): biblio +/
- type["glossary_section"] = State.off;
- type["biblio_section"] = State.on;
- type["blurb_section"] = State.off;
+ obj_type_status["glossary_section"] = State.off;
+ obj_type_status["biblio_section"] = State.on;
+ obj_type_status["blurb_section"] = State.off;
if (opt_action["backmatter"] && opt_action["section_biblio"]) {
- _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json);
+ _biblio_block_(line, obj_type_status, bib_entry, biblio_entry_str_json, biblio_arr_json);
debug(bibliobuild) {
writeln("- ", biblio_entry_str_json);
writeln("-> ", biblio_arr_json.length);
@@ -408,7 +408,7 @@ template SiSUdocAbstraction() {
}
continue;
} else if (line.matchFirst(rgx.heading_glossary)
- || (type["glossary_section"] == State.on
+ || (obj_type_status["glossary_section"] == State.on
&& (!(line.matchFirst(rgx.heading_biblio_blurb)))
&& (!(line.matchFirst(rgx.heading)))
&& (!(line.matchFirst(rgx.comment))))) {
@@ -417,16 +417,16 @@ template SiSUdocAbstraction() {
writeln(__LINE__);
writeln(line);
}
- type["glossary_section"] = State.on;
- type["biblio_section"] = State.off;
- type["blurb_section"] = State.off;
+ obj_type_status["glossary_section"] = State.on;
+ obj_type_status["biblio_section"] = State.off;
+ obj_type_status["blurb_section"] = State.off;
if (opt_action["backmatter"] && opt_action["section_glossary"]) {
indent=[
"hang_position" : 0,
"base_position" : 0,
];
bullet = false;
- type["para"] = State.on;
+ obj_type_status["para"] = State.on;
line_occur["para"] = State.off;
an_object_key="glossary_nugget"; //
if (line.matchFirst(rgx.heading_glossary)) {
@@ -464,7 +464,7 @@ template SiSUdocAbstraction() {
comp_obj_heading_.anchor_tags = ["glossary"];
the_glossary_section ~= comp_obj_heading_;
} else {
- _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur);
+ _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur);
comp_obj_para = comp_obj_para.init;
comp_obj_para.use = "backmatter";
comp_obj_para.is_of = "para";
@@ -477,11 +477,11 @@ template SiSUdocAbstraction() {
comp_obj_para.bullet = bullet;
the_glossary_section ~= comp_obj_para;
}
- type["ocn_status"] = TriState.off;
+ obj_type_status["ocn_status"] = TriState.off;
}
continue;
} else if (line.matchFirst(rgx.heading_blurb)
- || (type["blurb_section"] == State.on
+ || (obj_type_status["blurb_section"] == State.on
&& (!(line.matchFirst(rgx.heading_biblio_glossary)))
&& (!(line.matchFirst(rgx.heading)))
&& (!(line.matchFirst(rgx.comment))))) {
@@ -490,16 +490,16 @@ template SiSUdocAbstraction() {
writeln(__LINE__);
writeln(line);
}
- type["glossary_section"] = State.off;
- type["biblio_section"] = State.off;
- type["blurb_section"] = State.on;
+ obj_type_status["glossary_section"] = State.off;
+ obj_type_status["biblio_section"] = State.off;
+ obj_type_status["blurb_section"] = State.on;
if (opt_action["backmatter"] && opt_action["section_blurb"]) {
indent=[
"hang_position" : 0,
"base_position" : 0,
];
bullet = false;
- type["para"] = State.on;
+ obj_type_status["para"] = State.on;
line_occur["para"] = State.off;
an_object_key="blurb_nugget";
if (line.matchFirst(rgx.heading_blurb)) {
@@ -553,7 +553,7 @@ template SiSUdocAbstraction() {
comp_obj_heading_.parent_lev_markup = 0;
the_blurb_section ~= comp_obj_heading_;
} else {
- _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur);
+ _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur);
comp_obj_para = comp_obj_para.init;
comp_obj_para.use = "backmatter";
comp_obj_para.is_of = "para";
@@ -566,21 +566,21 @@ template SiSUdocAbstraction() {
comp_obj_para.bullet = bullet;
the_blurb_section ~= comp_obj_para;
}
- type["ocn_status"] = TriState.off;
+ obj_type_status["ocn_status"] = TriState.off;
}
continue;
- } else if (type["quote"] == TriState.on) {
+ } else if (obj_type_status["quote"] == TriState.on) {
/+ within block object: quote +/
- _quote_block_(line, an_object, type);
+ _quote_block_(line, an_object, obj_type_status);
continue;
/+ within block object: group +/
- } else if (type["group"] == TriState.on) {
+ } else if (obj_type_status["group"] == TriState.on) {
/+ within block object: group +/
line = (line)
.replaceAll(rgx.para_delimiter, mkup.br_paragraph ~ "$1");
- _group_block_(line, an_object, type);
+ _group_block_(line, an_object, obj_type_status);
continue;
- } else if (type["block"] == TriState.on) {
+ } else if (obj_type_status["block"] == TriState.on) {
/+ within block object: block +/
if (auto m = line.match(rgx.spaces_line_start)) {
line = (line)
@@ -590,24 +590,24 @@ template SiSUdocAbstraction() {
line = (line)
.replaceAll(rgx.spaces_multiple, (m.captures[1]).translate([ ' ' : mkup.nbsp ]));
}
- _block_block_(line, an_object, type);
+ _block_block_(line, an_object, obj_type_status);
continue;
- } else if (type["poem"] == TriState.on) {
+ } else if (obj_type_status["poem"] == TriState.on) {
/+ within block object: poem +/
- _poem_block_(line, an_object, type, cntr, obj_cite_number_poem, dochead_make_aa);
+ _poem_block_(line, an_object, obj_type_status, cntr, obj_cite_number_poem, dochead_make_aa);
continue;
- } else if (type["table"] == TriState.on) {
+ } else if (obj_type_status["table"] == TriState.on) {
/+ within block object: table +/
- _table_block_(line, an_object, type, dochead_make_aa);
+ _table_block_(line, an_object, obj_type_status, dochead_make_aa);
continue;
} else {
/+ not within a block group +/
assert(
- (type["blocks"] == TriState.off)
- || (type["blocks"] == TriState.closing),
+ (obj_type_status["blocks"] == TriState.off)
+ || (obj_type_status["blocks"] == TriState.closing),
"block status: none or closed"
);
- assertions_flag_types_block_status_none_or_closed(type);
+ assertions_flag_types_block_status_none_or_closed(obj_type_status);
if (line.matchFirst(rgx.block_open)) {
if (line.matchFirst(rgx.block_poem_open)) {
/+ poem to verse exceptions! +/
@@ -615,7 +615,7 @@ template SiSUdocAbstraction() {
processing.remove("verse");
obj_cite_number_poem["start"] = obj_cite_number.to!string;
}
- _start_block_(line, type, obj_cite_number_poem);
+ _start_block_(line, obj_type_status, obj_cite_number_poem);
continue;
} else if (!line.empty) {
/+ line not empty +/
@@ -625,11 +625,11 @@ template SiSUdocAbstraction() {
"line tested, line not empty surely:\n \"" ~ line ~ "\""
);
assert(
- (type["blocks"] == TriState.off)
- || (type["blocks"] == TriState.closing),
+ (obj_type_status["blocks"] == TriState.off)
+ || (obj_type_status["blocks"] == TriState.closing),
"code block status: none or closed"
);
- if (type["blocks"] == TriState.closing) {
+ if (obj_type_status["blocks"] == TriState.closing) {
debug(check) { // block
writeln(__LINE__);
writeln(line);
@@ -637,16 +637,16 @@ template SiSUdocAbstraction() {
assert(
line.matchFirst(rgx.book_index)
|| line.matchFirst(rgx.book_index_open)
- || type["book_index"] == State.on,
+ || obj_type_status["book_index"] == State.on,
"\nblocks closed, unless followed by book index, non-matching line:\n \""
~ line ~ "\""
);
}
if (line.matchFirst(rgx.book_index)
|| line.matchFirst(rgx.book_index_open)
- || type["book_index"] == State.on ) {
+ || obj_type_status["book_index"] == State.on ) {
/+ book_index +/
- _book_index_(line, book_idx_tmp, an_object, type, opt_action);
+ _book_index_(line, book_idx_tmp, an_object, obj_type_status, opt_action);
} else {
/+ not book_index +/
an_object_key="body_nugget";
@@ -662,26 +662,26 @@ template SiSUdocAbstraction() {
comp_obj_comment.is_a = "comment";
comp_obj_comment.text = an_object[an_object_key].strip;
the_document_body_section ~= comp_obj_comment;
- _common_reset_(line_occur, an_object, type);
+ _common_reset_(line_occur, an_object, obj_type_status);
processing.remove("verse");
++cntr;
} else if (((line_occur["para"] == State.off)
&& (line_occur["heading"] == State.off))
- && ((type["para"] == State.off)
- && (type["heading"] == State.off))) {
+ && ((obj_type_status["para"] == State.off)
+ && (obj_type_status["heading"] == State.off))) {
/+ heading or para but neither flag nor line exists +/
if ((dochead_make_aa["make"]["headings"].length > 2)
- && (type["make_headings"] == State.off)) {
+ && (obj_type_status["make_headings"] == State.off)) {
/+ heading found +/
- _heading_found_(line, dochead_make_aa["make"]["headings"], heading_match_str, heading_match_rgx, type);
+ _heading_found_(line, dochead_make_aa["make"]["headings"], heading_match_str, heading_match_rgx, obj_type_status);
}
- if ((type["make_headings"] == State.on)
+ if ((obj_type_status["make_headings"] == State.on)
&& ((line_occur["para"] == State.off)
&& (line_occur["heading"] == State.off))
- && ((type["para"] == State.off)
- && (type["heading"] == State.off))) {
+ && ((obj_type_status["para"] == State.off)
+ && (obj_type_status["heading"] == State.off))) {
/+ heading make set +/
- line = _heading_make_set_(line, line_occur, heading_match_rgx, type);
+ line = _heading_make_set_(line, line_occur, heading_match_rgx, obj_type_status);
}
/+ TODO node info: all headings identified at this point,
- extract node info here??
@@ -691,11 +691,11 @@ template SiSUdocAbstraction() {
+/
if (line.matchFirst(rgx.heading)) {
/+ heading match +/
- _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa);
+ _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, obj_type_status, dochead_meta_aa);
} else if (line_occur["para"] == State.off) {
/+ para match +/
an_object_key="body_nugget";
- _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur);
+ _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur);
}
} else if (line_occur["heading"] > State.off) {
/+ heading +/
@@ -713,7 +713,7 @@ template SiSUdocAbstraction() {
++line_occur["para"];
}
}
- } else if (type["blocks"] == TriState.closing) {
+ } else if (obj_type_status["blocks"] == TriState.closing) {
/+ line empty, with blocks flag +/
_block_flag_line_empty_(
bookindex_extract_hash,
@@ -724,7 +724,7 @@ template SiSUdocAbstraction() {
obj_cite_number,
comp_obj_heading,
cntr,
- type,
+ obj_type_status,
obj_cite_number_poem,
dochead_make_aa
);
@@ -736,15 +736,15 @@ template SiSUdocAbstraction() {
~ line ~ "\""
);
assert(
- (type["blocks"] == State.off),
+ (obj_type_status["blocks"] == State.off),
"code block status: none"
);
- if ((type["heading"] == State.on)
+ if ((obj_type_status["heading"] == State.on)
&& (line_occur["heading"] > State.off)) {
/+ heading object (current line empty) +/
obj_cite_number = (an_object["lev_markup_number"].to!int == 0)
? (ocn_emit(3))
- : (obj_cite_number = ocn_emit(type["ocn_status"]));
+ : (obj_cite_number = ocn_emit(obj_type_status["ocn_status"]));
an_object["is"] = "heading";
an_object_key="body_nugget";
auto substantive_object_and_anchor_tags_tuple =
@@ -827,15 +827,15 @@ template SiSUdocAbstraction() {
debug(objectrelated1) { // check
writeln(line);
}
- _common_reset_(line_occur, an_object, type);
+ _common_reset_(line_occur, an_object, obj_type_status);
an_object.remove("lev");
an_object.remove("lev_markup_number");
processing.remove("verse");
++cntr;
- } else if ((type["para"] == State.on)
+ } else if ((obj_type_status["para"] == State.on)
&& (line_occur["para"] > State.off)) {
/+ paragraph object (current line empty) +/
- obj_cite_number = ocn_emit(type["ocn_status"]);
+ obj_cite_number = ocn_emit(obj_type_status["ocn_status"]);
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
@@ -869,7 +869,7 @@ template SiSUdocAbstraction() {
comp_obj_para.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star];
comp_obj_para.inline_links = substantive_obj_misc_tuple[sObj.links];
the_document_body_section ~= comp_obj_para;
- _common_reset_(line_occur, an_object, type);
+ _common_reset_(line_occur, an_object, obj_type_status);
indent=[
"hang_position" : 0,
"base_position" : 0,
@@ -897,9 +897,9 @@ template SiSUdocAbstraction() {
&& (the_document_body_section.length > previous_length)) {
if ((the_document_body_section[$-1].is_a == "heading")
&& (the_document_body_section[$-1].heading_lev_markup < 5)) {
- type["biblio_section"] = State.off;
- type["glossary_section"] = State.off;
- type["blurb_section"] = State.off;
+ obj_type_status["biblio_section"] = State.off;
+ obj_type_status["glossary_section"] = State.off;
+ obj_type_status["blurb_section"] = State.off;
}
if (the_document_body_section[$-1].is_a == "verse") {
/+ scan for endnotes for whole poem (each verse in poem) +/
@@ -1621,9 +1621,6 @@ template SiSUdocAbstraction() {
comp_obj_heading_.parent_lev_markup = 0;
comp_obj_heading_.dom_markedup = dom_markedup.dup;
comp_obj_heading_.dom_collapsed = dom_collapsed.dup;
- obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0);
- obj_dom_set_collapsed_tags(comp_obj_heading_, dom_collapsed, 0);
- obj_heading_ancestors(comp_obj_heading_, lv_ancestors_txt);
comp_obj_heading_ = obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0);
comp_obj_heading_ = obj_dom_set_collapsed_tags(comp_obj_heading_, dom_collapsed, 0);
comp_obj_heading_ = obj_heading_ancestors(comp_obj_heading_, lv_ancestors_txt);
@@ -1729,77 +1726,77 @@ template SiSUdocAbstraction() {
auto _common_reset_(L,O,T)(
return ref L line_occur,
return ref O an_object,
- return ref T type
+ return ref T obj_type_status
) {
debug(asserts) {
- static assert(is(typeof(line_occur) == int[string]));
- static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
- }
- line_occur["heading"] = State.off;
- line_occur["para"] = State.off;
- type["heading"] = State.off;
- type["para"] = State.off;
+ static assert(is(typeof(line_occur) == int[string]));
+ static assert(is(typeof(an_object) == string[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
+ }
+ line_occur["heading"] = State.off;
+ line_occur["para"] = State.off;
+ obj_type_status["heading"] = State.off;
+ obj_type_status["para"] = State.off;
an_object = object_reset(an_object);
}
static auto _check_ocn_status_(L,T)(
L line,
- T type
+ T obj_type_status
) {
debug(asserts) {
static assert(is(typeof(line) == char[]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
- if ((!line.empty) && (type["ocn_status_multi_obj"] == TriState.off)) {
+ if ((!line.empty) && (obj_type_status["ocn_status_off_for_multiple_objects"] == TriState.off)) {
/+ not multi-line object, check whether obj_cite_number is on or turned off +/
if (line.matchFirst(rgx.obj_cite_number_block_marks)) {
/+ switch off obj_cite_number +/
if (line.matchFirst(rgx.obj_cite_number_off_block)) {
- type["ocn_status_multi_obj"] = TriState.on;
+ obj_type_status["ocn_status_off_for_multiple_objects"] = TriState.on;
debug(ocnoff) {
writeln(line);
}
}
if (line.matchFirst(rgx.obj_cite_number_off_block_dh)) {
- type["ocn_status_multi_obj"] = TriState.closing;
+ obj_type_status["ocn_status_off_for_multiple_objects"] = TriState.closing;
debug(ocnoff) {
writeln(line);
}
}
} else {
- if (type["ocn_status_multi_obj"] == TriState.off) {
+ if (obj_type_status["ocn_status_off_for_multiple_objects"] == TriState.off) {
if (line.matchFirst(rgx.obj_cite_number_off)) {
- type["ocn_status"] = TriState.on;
+ obj_type_status["ocn_status"] = TriState.on;
} else if (line.matchFirst(rgx.obj_cite_number_off_dh)) {
- type["ocn_status"] = TriState.closing;
+ obj_type_status["ocn_status"] = TriState.closing;
} else {
- type["ocn_status"] = TriState.off;
+ obj_type_status["ocn_status"] = TriState.off;
}
} else {
- type["ocn_status"] =
- type["ocn_status_multi_obj"];
+ obj_type_status["ocn_status"] =
+ obj_type_status["ocn_status_off_for_multiple_objects"];
}
}
- } else if ((!line.empty) && (type["ocn_status_multi_obj"] > TriState.off)) {
+ } else if ((!line.empty) && (obj_type_status["ocn_status_off_for_multiple_objects"] > TriState.off)) {
if (line.matchFirst(rgx.obj_cite_number_off_block_close)) {
- type["ocn_status_multi_obj"] = TriState.off;
- type["ocn_status"] = TriState.off;
+ obj_type_status["ocn_status_off_for_multiple_objects"] = TriState.off;
+ obj_type_status["ocn_status"] = TriState.off;
debug(ocnoff) {
writeln(line);
}
}
}
- return type;
+ return obj_type_status;
}
void _start_block_(L,T,N)(
L line,
- return ref T type,
+ return ref T obj_type_status,
return ref N obj_cite_number_poem
) {
debug(asserts) {
static assert(is(typeof(line) == char[]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
static assert(is(typeof(obj_cite_number_poem) == string[string]));
}
static auto rgx = Rgx();
@@ -1815,9 +1812,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["code"] = TriState.on;
- type["curly_code"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["code"] = TriState.on;
+ obj_type_status["curly_code"] = TriState.on;
} else if (line.matchFirst(rgx.block_curly_poem_open)) {
/+ curly poem open +/
debug(poem) { // poem (curly) open
@@ -1828,10 +1825,10 @@ template SiSUdocAbstraction() {
}
obj_cite_number_poem["start"] =
obj_cite_number.to!string;
- type["blocks"] = TriState.on;
- type["verse_new"] = State.on;
- type["poem"] = TriState.on;
- type["curly_poem"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["verse_new"] = State.on;
+ obj_type_status["poem"] = TriState.on;
+ obj_type_status["curly_poem"] = TriState.on;
} else if (line.matchFirst(rgx.block_curly_group_open)) {
/+ curly group open +/
debug(group) { // group (curly) open
@@ -1840,9 +1837,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["group"] = TriState.on;
- type["curly_group"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["group"] = TriState.on;
+ obj_type_status["curly_group"] = TriState.on;
} else if (line.matchFirst(rgx.block_curly_block_open)) {
/+ curly block open +/
debug(block) { // block (curly) open
@@ -1851,9 +1848,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["block"] = TriState.on;
- type["curly_block"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["block"] = TriState.on;
+ obj_type_status["curly_block"] = TriState.on;
} else if (line.matchFirst(rgx.block_curly_quote_open)) {
/+ curly quote open +/
debug(quote) { // quote (curly) open
@@ -1862,9 +1859,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["quote"] = TriState.on;
- type["curly_quote"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["quote"] = TriState.on;
+ obj_type_status["curly_quote"] = TriState.on;
} else if (auto m = line.matchFirst(rgx.block_curly_table_open)) {
/+ curly table open +/
debug(table) { // table (curly) open
@@ -1873,18 +1870,18 @@ template SiSUdocAbstraction() {
line
);
}
- an_object["table_head"] = m.captures[1].to!string;
- an_object["block_type"] = "curly";
- type["blocks"] = TriState.on;
- type["table"] = TriState.on;
- type["curly_table"] = TriState.on;
+ an_object["table_head"] = m.captures[1].to!string;
+ an_object["block_type"] = "curly";
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["table"] = TriState.on;
+ obj_type_status["curly_table"] = TriState.on;
} else if (auto m = line.matchFirst(rgx.block_curly_table_special_markup)) {
/+ table: special table block markup syntax! +/
- an_object["table_head"] = m.captures[1].to!string;
- an_object["block_type"] = "special";
- type["blocks"] = TriState.on;
- type["table"] = TriState.on;
- type["curly_table_special_markup"] = TriState.on;
+ an_object["table_head"] = m.captures[1].to!string;
+ an_object["block_type"] = "special";
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["table"] = TriState.on;
+ obj_type_status["curly_table_special_markup"] = TriState.on;
} else if (auto m = line.matchFirst(rgx.block_tic_code_open)) {
/+ tic code open +/
code_block_syntax = (m.captures[1]) ? m.captures[1].to!string : "";
@@ -1895,9 +1892,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["code"] = TriState.on;
- type["tic_code"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["code"] = TriState.on;
+ obj_type_status["tic_code"] = TriState.on;
} else if (line.matchFirst(rgx.block_tic_poem_open)) {
/+ tic poem open +/
debug(poem) { // poem (tic) open
@@ -1907,10 +1904,10 @@ template SiSUdocAbstraction() {
);
}
obj_cite_number_poem["start"] = obj_cite_number.to!string;
- type["blocks"] = TriState.on;
- type["verse_new"] = State.on;
- type["poem"] = TriState.on;
- type["tic_poem"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["verse_new"] = State.on;
+ obj_type_status["poem"] = TriState.on;
+ obj_type_status["tic_poem"] = TriState.on;
} else if (line.matchFirst(rgx.block_tic_group_open)) {
/+ tic group open +/
debug(group) { // group (tic) open
@@ -1919,9 +1916,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["group"] = TriState.on;
- type["tic_group"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["group"] = TriState.on;
+ obj_type_status["tic_group"] = TriState.on;
} else if (line.matchFirst(rgx.block_tic_block_open)) {
/+ tic block open +/
debug(block) { // block (tic) open
@@ -1930,9 +1927,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["block"] = TriState.on;
- type["tic_block"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["block"] = TriState.on;
+ obj_type_status["tic_block"] = TriState.on;
} else if (line.matchFirst(rgx.block_tic_quote_open)) {
/+ tic quote open +/
debug(quote) { // quote (tic) open
@@ -1941,9 +1938,9 @@ template SiSUdocAbstraction() {
line
);
}
- type["blocks"] = TriState.on;
- type["quote"] = TriState.on;
- type["tic_quote"] = TriState.on;
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["quote"] = TriState.on;
+ obj_type_status["tic_quote"] = TriState.on;
} else if (auto m = line.matchFirst(rgx.block_tic_table_open)) {
/+ tic table open +/
debug(table) { // table (tic) open
@@ -1952,48 +1949,48 @@ template SiSUdocAbstraction() {
line
);
}
- an_object["table_head"] = m.captures[1].to!string;
- an_object["block_type"] = "tic";
- type["blocks"] = TriState.on;
- type["table"] = TriState.on;
- type["tic_table"] = TriState.on;
+ an_object["table_head"] = m.captures[1].to!string;
+ an_object["block_type"] = "tic";
+ obj_type_status["blocks"] = TriState.on;
+ obj_type_status["table"] = TriState.on;
+ obj_type_status["tic_table"] = TriState.on;
}
}
void _quote_block_(L,O,T)(
L line,
return ref O an_object,
- return ref T type
+ return ref T obj_type_status
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(an_object) == string[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
- if (type["curly_quote"] == TriState.on) {
+ if (obj_type_status["curly_quote"] == TriState.on) {
if (line.matchFirst(rgx.block_curly_quote_close)) {
debug(quote) { // quote (curly) close
writeln(line);
}
an_object[an_object_key] = an_object[an_object_key].stripRight;
- type["blocks"] = TriState.closing;
- type["quote"] = TriState.closing;
- type["curly_quote"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["quote"] = TriState.closing;
+ obj_type_status["curly_quote"] = TriState.off;
} else {
debug(quote) {
writeln(line);
}
an_object[an_object_key] ~= line ~= "\n"; // build quote array (or string)
}
- } else if (type["tic_quote"] == TriState.on) {
+ } else if (obj_type_status["tic_quote"] == TriState.on) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(quote) { // quote (tic) close
writeln(line);
}
an_object[an_object_key] = an_object[an_object_key].stripRight;
- type["blocks"] = TriState.closing;
- type["quote"] = TriState.closing;
- type["tic_quote"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["quote"] = TriState.closing;
+ obj_type_status["tic_quote"] = TriState.off;
} else {
debug(quote) {
writeln(line);
@@ -2005,38 +2002,38 @@ template SiSUdocAbstraction() {
void _group_block_(L,O,T)(
L line,
return ref O an_object,
- return ref T type
+ return ref T obj_type_status
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(an_object) == string[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
- if (type["curly_group"] == State.on) {
+ if (obj_type_status["curly_group"] == State.on) {
if (line.matchFirst(rgx.block_curly_group_close)) {
debug(group) {
writeln(line);
}
an_object[an_object_key] = an_object[an_object_key].stripRight;
- type["blocks"] = TriState.closing;
- type["group"] = TriState.closing;
- type["curly_group"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["group"] = TriState.closing;
+ obj_type_status["curly_group"] = TriState.off;
} else {
debug(group) {
writeln(line);
}
an_object[an_object_key] ~= line ~= "\n"; // build group array (or string)
}
- } else if (type["tic_group"] == TriState.on) {
+ } else if (obj_type_status["tic_group"] == TriState.on) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(group) {
writeln(line);
}
an_object[an_object_key] = an_object[an_object_key].stripRight;
- type["blocks"] = TriState.closing;
- type["group"] = TriState.closing;
- type["tic_group"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["group"] = TriState.closing;
+ obj_type_status["tic_group"] = TriState.off;
} else {
debug(group) { // group
writeln(line);
@@ -2048,38 +2045,38 @@ template SiSUdocAbstraction() {
void _block_block_(L,O,T)(
L line,
return ref O an_object,
- return ref T type
+ return ref T obj_type_status
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(an_object) == string[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
- if (type["curly_block"] == TriState.on) {
+ if (obj_type_status["curly_block"] == TriState.on) {
if (line.matchFirst(rgx.block_curly_block_close)) {
debug(block) { // block (curly) close
writeln(line);
}
an_object[an_object_key] = an_object[an_object_key].stripRight;
- type["blocks"] = TriState.closing;
- type["block"] = TriState.closing;
- type["curly_block"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["block"] = TriState.closing;
+ obj_type_status["curly_block"] = TriState.off;
} else {
debug(block) {
writeln(line);
}
an_object[an_object_key] ~= line ~= "\n"; // build block array (or string)
}
- } else if (type["tic_block"] == TriState.on) {
+ } else if (obj_type_status["tic_block"] == TriState.on) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(block) {
writeln(line);
}
an_object[an_object_key] = an_object[an_object_key].stripRight;
- type["blocks"] = TriState.closing;
- type["block"] = TriState.closing;
- type["tic_block"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["block"] = TriState.closing;
+ obj_type_status["tic_block"] = TriState.off;
} else {
debug(block) {
writeln(line);
@@ -2091,7 +2088,7 @@ template SiSUdocAbstraction() {
void _poem_block_(L,O,T,C,N,Ma)(
L line,
return ref O an_object,
- return ref T type,
+ return ref T obj_type_status,
return ref C cntr,
N obj_cite_number_poem,
Ma dochead_make_aa,
@@ -2099,13 +2096,13 @@ template SiSUdocAbstraction() {
debug(asserts) {
static assert(is(typeof(line) == char[]));
static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
static assert(is(typeof(cntr) == int));
static assert(is(typeof(obj_cite_number_poem) == string[string]));
static assert(is(typeof(dochead_make_aa) == string[string][string]));
}
static auto rgx = Rgx();
- if (type["curly_poem"] == TriState.on) {
+ if (obj_type_status["curly_poem"] == TriState.on) {
if (line.matchFirst(rgx.block_curly_poem_close)) {
if (an_object_key in an_object
|| processing.length > 0) {
@@ -2157,21 +2154,21 @@ template SiSUdocAbstraction() {
}
obj_cite_number_poem["end"] =
obj_cite_number.to!string;
- type["blocks"] = TriState.closing;
- type["poem"] = TriState.closing;
- type["curly_poem"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["poem"] = TriState.closing;
+ obj_type_status["curly_poem"] = TriState.off;
} else {
processing["verse"] ~= line ~= "\n";
- if (type["verse_new"] == State.on) {
+ if (obj_type_status["verse_new"] == State.on) {
obj_cite_number =
- ocn_emit(type["ocn_status"]);
- type["verse_new"] = State.off;
+ ocn_emit(obj_type_status["ocn_status"]);
+ obj_type_status["verse_new"] = State.off;
} else if (line.matchFirst(rgx.newline_eol_delimiter_only)) {
processing["verse"] = processing["verse"].stripRight;
verse_line = TriState.off;
- type["verse_new"] = State.on;
+ obj_type_status["verse_new"] = State.on;
}
- if (type["verse_new"] == State.on) {
+ if (obj_type_status["verse_new"] == State.on) {
verse_line=1;
an_object[an_object_key] = processing["verse"];
debug(poem) { // poem verse
@@ -2211,7 +2208,7 @@ template SiSUdocAbstraction() {
++cntr;
}
}
- } else if (type["tic_poem"] == TriState.on) {
+ } else if (obj_type_status["tic_poem"] == TriState.on) {
if (auto m = line.matchFirst(rgx.block_tic_close)) { // tic_poem_close
an_object[an_object_key]="verse";
debug(poem) { // poem (curly) close
@@ -2250,21 +2247,21 @@ template SiSUdocAbstraction() {
processing.remove("verse");
++cntr;
}
- type["blocks"] = TriState.closing;
- type["poem"] = TriState.closing;
- type["tic_poem"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["poem"] = TriState.closing;
+ obj_type_status["tic_poem"] = TriState.off;
} else {
processing["verse"] ~= line ~= "\n";
- if (type["verse_new"] == State.on) {
+ if (obj_type_status["verse_new"] == State.on) {
obj_cite_number =
- ocn_emit(type["ocn_status"]);
- type["verse_new"] = State.off;
+ ocn_emit(obj_type_status["ocn_status"]);
+ obj_type_status["verse_new"] = State.off;
} else if (line.matchFirst(rgx.newline_eol_delimiter_only)) {
processing["verse"] = processing["verse"].stripRight;
- type["verse_new"] = State.on;
+ obj_type_status["verse_new"] = State.on;
verse_line = TriState.off;
}
- if (type["verse_new"] == State.on) {
+ if (obj_type_status["verse_new"] == State.on) {
verse_line=1;
an_object[an_object_key] = processing["verse"];
debug(poem) { // poem (tic) close
@@ -2310,15 +2307,15 @@ template SiSUdocAbstraction() {
void _code_block_(L,O,T)(
L line,
return ref O an_object,
- return ref T type
+ return ref T obj_type_status
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(an_object) == string[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
- if (type["curly_code"] == TriState.on) {
+ if (obj_type_status["curly_code"] == TriState.on) {
if (line.matchFirst(rgx.block_curly_code_close)) {
debug(code) { // code (curly) close
writeln(line);
@@ -2326,16 +2323,16 @@ template SiSUdocAbstraction() {
an_object[an_object_key] = an_object[an_object_key]
.replaceFirst(rgx.newline_eol_delimiter_only, "")
.stripRight;
- type["blocks"] = TriState.closing;
- type["code"] = TriState.closing;
- type["curly_code"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["code"] = TriState.closing;
+ obj_type_status["curly_code"] = TriState.off;
} else {
debug(code) { // code (curly) line
writeln(line);
}
an_object[an_object_key] ~= line ~= "\n"; // code (curly) line
}
- } else if (type["tic_code"] == TriState.on) {
+ } else if (obj_type_status["tic_code"] == TriState.on) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(code) { // code (tic) close
writeln(line);
@@ -2343,9 +2340,9 @@ template SiSUdocAbstraction() {
an_object[an_object_key] = an_object[an_object_key]
.replaceFirst(rgx.newline_eol_delimiter_only, "")
.stripRight;
- type["blocks"] = TriState.closing;
- type["code"] = TriState.closing;
- type["tic_code"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["code"] = TriState.closing;
+ obj_type_status["tic_code"] = TriState.off;
} else {
debug(code) { // code (tic) line
writeln(line);
@@ -2357,34 +2354,34 @@ template SiSUdocAbstraction() {
void _table_block_(L,O,T,Ma)(
L line,
return ref O an_object,
- return ref T type,
+ return ref T obj_type_status,
return ref Ma dochead_make_aa
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(an_object) == string[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
- if (type["curly_table"] == TriState.on) {
+ if (obj_type_status["curly_table"] == TriState.on) {
if (line.matchFirst(rgx.block_curly_table_close)) {
debug(table) { // table (curly) close
writeln(line);
}
- type["blocks"] = TriState.closing;
- type["table"] = TriState.closing;
- type["curly_table"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["table"] = TriState.closing;
+ obj_type_status["curly_table"] = TriState.off;
} else {
debug(table) { // table
writeln(line);
}
an_object[an_object_key] ~= line ~= "\n"; // build table array (or string)
}
- } else if (type["curly_table_special_markup"] == TriState.on) {
+ } else if (obj_type_status["curly_table_special_markup"] == TriState.on) {
if (line.empty) {
- type["blocks"] = TriState.off;
- type["table"] = TriState.off;
- type["curly_table_special_markup"] = TriState.off;
+ obj_type_status["blocks"] = TriState.off;
+ obj_type_status["table"] = TriState.off;
+ obj_type_status["curly_table_special_markup"] = TriState.off;
_table_closed_make_special_notation_table_(
line,
an_object,
@@ -2392,7 +2389,7 @@ template SiSUdocAbstraction() {
obj_cite_number,
comp_obj_heading,
cntr,
- type,
+ obj_type_status,
dochead_make_aa
);
} else {
@@ -2401,14 +2398,14 @@ template SiSUdocAbstraction() {
}
an_object[an_object_key] ~= line ~= "\n";
}
- } else if (type["tic_table"] == TriState.on) {
+ } else if (obj_type_status["tic_table"] == TriState.on) {
if (line.matchFirst(rgx.block_tic_close)) {
debug(table) { // table (tic) close
writeln(line);
}
- type["blocks"] = TriState.closing;
- type["table"] = TriState.closing;
- type["tic_table"] = TriState.off;
+ obj_type_status["blocks"] = TriState.closing;
+ obj_type_status["table"] = TriState.closing;
+ obj_type_status["tic_table"] = TriState.off;
} else {
debug(table) { // table
writeln(line);
@@ -2441,7 +2438,7 @@ template SiSUdocAbstraction() {
}
void _biblio_block_(
char[] line,
- return ref int[string] type,
+ return ref int[string] obj_type_status,
return ref int bib_entry,
return ref string biblio_entry_str_json,
return ref string[] biblio_arr_json
@@ -2450,9 +2447,9 @@ template SiSUdocAbstraction() {
auto jsn = BibJsnStr();
static auto rgx = Rgx();
if (line.matchFirst(rgx.heading_biblio)) {
- type["biblio_section"] = TriState.on;
- type["blurb_section"] = State.off;
- type["glossary_section"] = State.off;
+ obj_type_status["biblio_section"] = TriState.on;
+ obj_type_status["blurb_section"] = State.off;
+ obj_type_status["glossary_section"] = State.off;
}
if (line.empty) {
debug {
@@ -2568,12 +2565,12 @@ template SiSUdocAbstraction() {
return ref int obj_cite_number,
return ref ObjGenericComposite _comp_obj_heading,
return ref int cntr,
- return ref int[string] type,
+ return ref int[string] obj_type_status,
string[string][string] dochead_make_aa,
) {
comp_obj_block = comp_obj_block.init;
obj_cite_number =
- ocn_emit(type["ocn_status"]);
+ ocn_emit(obj_type_status["ocn_status"]);
auto comp_obj_location =
node_construct.node_location_emitter(
content_non_header,
@@ -2605,7 +2602,7 @@ template SiSUdocAbstraction() {
return ref int obj_cite_number,
return ref ObjGenericComposite _comp_obj_heading,
return ref int cntr,
- return ref int[string] type,
+ return ref int[string] obj_type_status,
string[string] obj_cite_number_poem,
string[string][string] dochead_make_aa,
) {
@@ -2615,13 +2612,13 @@ template SiSUdocAbstraction() {
~ line ~ "\""
);
assert(
- (type["blocks"] == TriState.closing),
+ (obj_type_status["blocks"] == TriState.closing),
"code block status: closed"
);
- assertions_flag_types_block_status_none_or_closed(type);
- if (type["quote"] == TriState.closing) {
+ assertions_flag_types_block_status_none_or_closed(obj_type_status);
+ if (obj_type_status["quote"] == TriState.closing) {
obj_cite_number =
- ocn_emit(type["ocn_status"]);
+ ocn_emit(obj_type_status["ocn_status"]);
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
@@ -2655,14 +2652,14 @@ template SiSUdocAbstraction() {
comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star];
comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links];
the_document_body_section ~= comp_obj_block;
- type["blocks"] = TriState.off;
- type["quote"] = TriState.off;
+ obj_type_status["blocks"] = TriState.off;
+ obj_type_status["quote"] = TriState.off;
object_reset(an_object);
processing.remove("verse");
++cntr;
- } else if (type["group"] == TriState.closing) {
+ } else if (obj_type_status["group"] == TriState.closing) {
obj_cite_number =
- ocn_emit(type["ocn_status"]);
+ ocn_emit(obj_type_status["ocn_status"]);
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
@@ -2696,13 +2693,13 @@ template SiSUdocAbstraction() {
comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star];
comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links];
the_document_body_section ~= comp_obj_block;
- type["blocks"] = TriState.off;
- type["group"] = TriState.off;
+ obj_type_status["blocks"] = TriState.off;
+ obj_type_status["group"] = TriState.off;
object_reset(an_object);
processing.remove("verse");
++cntr;
- } else if (type["block"] == TriState.closing) {
- obj_cite_number = ocn_emit(type["ocn_status"]);
+ } else if (obj_type_status["block"] == TriState.closing) {
+ obj_cite_number = ocn_emit(obj_type_status["ocn_status"]);
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
@@ -2735,12 +2732,12 @@ template SiSUdocAbstraction() {
comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star];
comp_obj_block.inline_links = substantive_obj_misc_tuple[sObj.links];
the_document_body_section ~= comp_obj_block;
- type["blocks"] = TriState.off;
- type["block"] = TriState.off;
+ obj_type_status["blocks"] = TriState.off;
+ obj_type_status["block"] = TriState.off;
object_reset(an_object);
processing.remove("verse");
++cntr;
- } else if (type["poem"] == TriState.closing) {
+ } else if (obj_type_status["poem"] == TriState.closing) {
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
@@ -2767,13 +2764,13 @@ template SiSUdocAbstraction() {
comp_obj_poem_ocn.obj_cite_number = (obj_cite_number_poem["start"], obj_cite_number_poem["end"]);
comp_obj_poem_ocn.text = "";
the_document_body_section ~= comp_obj_poem_ocn;
- type["blocks"] = TriState.off;
- type["poem"] = TriState.off;
+ obj_type_status["blocks"] = TriState.off;
+ obj_type_status["poem"] = TriState.off;
object_reset(an_object);
processing.remove("verse");
- } else if (type["code"] == TriState.closing) {
+ } else if (obj_type_status["code"] == TriState.closing) {
obj_cite_number =
- ocn_emit(type["ocn_status"]);
+ ocn_emit(obj_type_status["ocn_status"]);
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
@@ -2807,15 +2804,15 @@ template SiSUdocAbstraction() {
comp_obj_code.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star];
comp_obj_code.inline_links = substantive_obj_misc_tuple[sObj.links];
the_document_body_section ~= comp_obj_code;
- type["blocks"] = TriState.off;
- type["code"] = TriState.off;
+ obj_type_status["blocks"] = TriState.off;
+ obj_type_status["code"] = TriState.off;
object_reset(an_object);
processing.remove("verse");
++cntr;
- } else if (type["table"] == TriState.closing) {
+ } else if (obj_type_status["table"] == TriState.closing) {
comp_obj_block = comp_obj_block.init;
obj_cite_number =
- ocn_emit(type["ocn_status"]);
+ ocn_emit(obj_type_status["ocn_status"]);
an_object["bookindex_nugget"] =
("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
bookindex_unordered_hashes =
@@ -2843,8 +2840,8 @@ template SiSUdocAbstraction() {
comp_obj_block = table_instructions(comp_obj_block, an_object["table_head"]);
comp_obj_block = table_substantive_munge(comp_obj_block, an_object["substantive"]);
the_document_body_section ~= comp_obj_block;
- type["blocks"] = TriState.off;
- type["table"] = TriState.off;
+ obj_type_status["blocks"] = TriState.off;
+ obj_type_status["table"] = TriState.off;
object_reset(an_object);
processing.remove("verse");
++cntr;
@@ -2854,14 +2851,14 @@ template SiSUdocAbstraction() {
L line,
return ref I book_idx_tmp,
return ref O an_object,
- return ref T type,
+ return ref T obj_type_status,
B opt_action,
) {
debug(asserts) {
static assert(is(typeof(line) == char[]));
static assert(is(typeof(book_idx_tmp) == string));
static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
static assert(is(typeof(opt_action) == bool[string]));
}
static auto rgx = Rgx();
@@ -2876,7 +2873,7 @@ template SiSUdocAbstraction() {
an_object["bookindex_nugget"] = m.captures[1].to!string;
} else if (auto m = line.match(rgx.book_index_open)) {
/+ match open book_index +/
- type["book_index"] = State.on;
+ obj_type_status["book_index"] = State.on;
if (opt_action["backmatter"] && opt_action["section_bookindex"]) {
book_idx_tmp = m.captures[1].to!string;
debug(bookindexmatch) { // book index
@@ -2886,10 +2883,10 @@ template SiSUdocAbstraction() {
);
}
}
- } else if (type["book_index"] == State.on ) {
+ } else if (obj_type_status["book_index"] == State.on ) {
/+ book_index flag set +/
if (auto m = line.match(rgx.book_index_close)) {
- type["book_index"] = State.off;
+ obj_type_status["book_index"] = State.off;
if (opt_action["backmatter"]
&& opt_action["section_bookindex"]) {
an_object["bookindex_nugget"] = book_idx_tmp ~ m.captures[1].to!string;
@@ -2914,18 +2911,18 @@ template SiSUdocAbstraction() {
X dochead_make_identify_unmarked_headings,
return ref H heading_match_str,
return ref R heading_match_rgx,
- return ref T type
+ return ref T obj_type_status
) {
debug(asserts) {
static assert(is(typeof(line) == char[]));
static assert(is(typeof(dochead_make_identify_unmarked_headings) == string));
static assert(is(typeof(heading_match_str) == string[string]));
static assert(is(typeof(heading_match_rgx) == Regex!(char)[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
if ((dochead_make_identify_unmarked_headings.length > 2)
- && (type["make_headings"] == State.off)) {
+ && (obj_type_status["make_headings"] == State.off)) {
/+ headings found +/
debug(headingsfound) {
writeln(dochead_make_identify_unmarked_headings);
@@ -2997,26 +2994,26 @@ template SiSUdocAbstraction() {
default:
break;
}
- type["make_headings"] = State.on;
+ obj_type_status["make_headings"] = State.on;
}
}
auto _heading_make_set_(L,C,R,T)(
L line,
C line_occur,
return ref R heading_match_rgx,
- return ref T type
+ return ref T obj_type_status
) {
debug(asserts) {
static assert(is(typeof(line) == char[]));
static assert(is(typeof(line_occur) == int[string]));
static assert(is(typeof(heading_match_rgx) == Regex!(char)[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
- if ((type["make_headings"] == State.on)
+ if ((obj_type_status["make_headings"] == State.on)
&& ((line_occur["para"] == State.off)
&& (line_occur["heading"] == State.off))
- && ((type["para"] == State.off)
- && (type["heading"] == State.off))) {
+ && ((obj_type_status["para"] == State.off)
+ && (obj_type_status["heading"] == State.off))) {
/+ heading make set +/
if (line.matchFirst(heading_match_rgx["h_B"])) {
line = "B~ " ~ line;
@@ -3070,7 +3067,7 @@ template SiSUdocAbstraction() {
return ref K an_object_key,
return ref Lv lv,
return ref Lc collapsed_lev,
- return ref T type,
+ return ref T obj_type_status,
return ref Me dochead_meta_aa,
) {
debug(asserts) {
@@ -3080,19 +3077,19 @@ template SiSUdocAbstraction() {
static assert(is(typeof(an_object_key) == string));
static assert(is(typeof(lv) == int[string]));
static assert(is(typeof(collapsed_lev) == int[string]));
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
static assert(is(typeof(dochead_meta_aa) == string[string][string]));
}
static auto rgx = Rgx();
if (auto m = line.match(rgx.heading)) {
/+ heading match +/
- type["heading"] = State.on;
+ obj_type_status["heading"] = State.on;
if (line.match(rgx.heading_seg_and_above)) {
- type["biblio_section"] = State.off;
- type["glossary_section"] = State.off;
- type["blurb_section"] = State.off;
+ obj_type_status["biblio_section"] = State.off;
+ obj_type_status["glossary_section"] = State.off;
+ obj_type_status["blurb_section"] = State.off;
}
- type["para"] = State.off;
+ obj_type_status["para"] = State.off;
++line_occur["heading"];
an_object[an_object_key] ~= line ~= "\n";
an_object["lev"] ~= m.captures[1];
@@ -3224,23 +3221,23 @@ template SiSUdocAbstraction() {
return ref K an_object_key,
return ref I indent,
return ref B bullet,
- return ref T type,
+ return ref T obj_type_status,
return ref C line_occur,
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(an_object) == string[string]));
- static assert(is(typeof(an_object_key) == string));
- static assert(is(typeof(indent) == int[string]));
- static assert(is(typeof(bullet) == bool));
- static assert(is(typeof(type) == int[string]));
- static assert(is(typeof(line_occur) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(an_object) == string[string]));
+ static assert(is(typeof(an_object_key) == string));
+ static assert(is(typeof(indent) == int[string]));
+ static assert(is(typeof(bullet) == bool));
+ static assert(is(typeof(obj_type_status) == int[string]));
+ static assert(is(typeof(line_occur) == int[string]));
}
static auto rgx = Rgx();
if (line_occur["para"] == State.off) {
line = font_faces_line(line);
/+ para matches +/
- type["para"] = State.on;
+ obj_type_status["para"] = State.on;
an_object[an_object_key] ~= line; // body_nugget
indent=[
"hang_position" : 0,
@@ -5547,29 +5544,29 @@ template SiSUdocAbstraction() {
break;
}
}
- pure void assertions_flag_types_block_status_none_or_closed(T)(T type) {
+ pure void assertions_flag_types_block_status_none_or_closed(T)(T obj_type_status) {
debug(asserts) {
- static assert(is(typeof(type) == int[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
assert(
- (type["code"] == TriState.off)
- || (type["code"] == TriState.closing),
+ (obj_type_status["code"] == TriState.off)
+ || (obj_type_status["code"] == TriState.closing),
"code block status: off or closing");
assert(
- (type["poem"] == TriState.off)
- || (type["poem"] == TriState.closing),
+ (obj_type_status["poem"] == TriState.off)
+ || (obj_type_status["poem"] == TriState.closing),
"poem status: off or closing");
assert(
- (type["table"] == TriState.off)
- || (type["table"] == TriState.closing),
+ (obj_type_status["table"] == TriState.off)
+ || (obj_type_status["table"] == TriState.closing),
"table status: off or closing");
assert(
- (type["group"] == TriState.off)
- || (type["group"] == TriState.closing),
+ (obj_type_status["group"] == TriState.off)
+ || (obj_type_status["group"] == TriState.closing),
"group block status: off or closing");
assert(
- (type["block"] == TriState.off)
- || (type["block"] == TriState.closing),
+ (obj_type_status["block"] == TriState.off)
+ || (obj_type_status["block"] == TriState.closing),
"block status: off or closing");
}
/+ abstraction functions assertions ↑ +/