From 8ac1f18739dfd2b0c0323c66d3b65def39b271ce Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 4 May 2020 14:52:55 -0400 Subject: renaming --- org/metaverse.org | 841 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 429 insertions(+), 412 deletions(-) (limited to 'org/metaverse.org') diff --git a/org/metaverse.org b/org/metaverse.org index 88c5e59..0192f1a 100644 --- a/org/metaverse.org +++ b/org/metaverse.org @@ -54,7 +54,7 @@ template docAbstraction() { foreach (line; markup_sourcefile_content) { /+ ↓ markup document/text line by line +/ // "line" variable can be empty but should never be null <> - if (obj_type_status["code"] == TriState.on) { + if (obj_type_status["code"] == eN.tri.on) { <> } else if (!matchFirst(line, rgx.skip_from_regular_parse)) { /+ object other than "code block" object +/ /+ (includes regular text paragraph, headings & blocks other than code) +/ @@ -67,7 +67,7 @@ template docAbstraction() { } else if (!line.empty) { /+ line not empty +/ /+ non blocks (headings, paragraphs) & closed blocks +/ <> - } else if (obj_type_status["blocks"] == TriState.closing) { /+ line empty, with blocks flag +/ + } else if (obj_type_status["blocks"] == eN.tri.closing) { /+ line empty, with blocks flag +/ <> } else { /+ line.empty, post contents, empty variables: +/ <> @@ -163,6 +163,30 @@ import mixin ObjectSetter; mixin InternalMarkup; mixin spineRgxIn; +@safe static auto eN() { + struct _e { + enum bi { + off, + on, + } + enum tri { + off, + on, + closing, + } + enum sect { + unset, + head, + toc, + substantive, + bibliography, + glossary, + book_index, + blurb, + } + } + return _e(); +} #+END_SRC *** initialize :initialize: @@ -184,8 +208,6 @@ string lev_anchor_tag; string[string][string] tag_assoc; string[] lv0_to_3_tags; /+ enum +/ -enum State { off, on } -enum TriState { off, on, closing } enum DocStructMarkupHeading { h_sect_A, h_sect_B, @@ -198,7 +220,6 @@ enum DocStructMarkupHeading { h_text_5, // extra level, drop content_non_header } // header section A-D; header text 1-4 -enum Status { off, on, } enum OCNstatus { on, off, bkidx, closing, reset, } enum OCN_off_block_status { off, on } enum OCNtype { ocn, non, bkidx, } @@ -536,7 +557,6 @@ scope(exit) { #+NAME: abs_init_rest #+BEGIN_SRC d mixin spineRgxDocStructFlags; -mixin spineDocStatus; mixin spineNode; auto node_para_int_ = node_metadata_para_int; auto node_para_str_ = node_metadata_para_str; @@ -560,7 +580,7 @@ uint[string] dochas = [ "images" : 0, ]; auto obj_type_status = flags_type_init; -int[string] track = [ +int[string] track_state = [ "section" : 0, "block" : 0, "obj" : 0, @@ -572,26 +592,26 @@ string[string] object_number_poem = [ ]; string[] lv_ancestors_txt = [ "", "", "", "", "", "", "", "", ]; int[string] lv = [ - "lv" : State.off, - "h0" : State.off, - "h1" : State.off, - "h2" : State.off, - "h3" : State.off, - "h4" : State.off, - "h5" : State.off, - "h6" : State.off, - "h7" : State.off, + "lv" : eN.bi.off, + "h0" : eN.bi.off, + "h1" : eN.bi.off, + "h2" : eN.bi.off, + "h3" : eN.bi.off, + "h4" : eN.bi.off, + "h5" : eN.bi.off, + "h6" : eN.bi.off, + "h7" : eN.bi.off, "lev_int_collapsed" : 0, ]; int[string] collapsed_lev = [ - "h0" : State.off, - "h1" : State.off, - "h2" : State.off, - "h3" : State.off, - "h4" : State.off, - "h5" : State.off, - "h6" : State.off, - "h7" : State.off + "h0" : eN.bi.off, + "h1" : eN.bi.off, + "h2" : eN.bi.off, + "h3" : eN.bi.off, + "h4" : eN.bi.off, + "h5" : eN.bi.off, + "h6" : eN.bi.off, + "h7" : eN.bi.off ]; string[string] heading_match_str = [ "h_A": "^(none)", @@ -746,15 +766,15 @@ line = line.inline_markup_faces; // by text line (rather than by text object), l #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d if (line.matchFirst(rgx.heading_biblio) -|| (track["section"] == status.sect.bibliography +|| (track_state["section"] == eN.sect.bibliography && ((!(line.matchFirst(rgx.heading_glossary))) && (!(line.matchFirst(rgx.heading_blurb))) && (!(line.matchFirst(rgx.heading))) && (!(line.matchFirst(rgx.comment))))) ) { - track["section"] = status.sect.bibliography; + track_state["section"] = eN.sect.bibliography; if (opt_action.backmatter && opt_action.section_biblio) { - line.flow_txt_block_biblio(obj_type_status, bib_entry, biblio_entry_str_json, biblio_arr_json, track); + line.flow_txt_block_biblio(obj_type_status, bib_entry, biblio_entry_str_json, biblio_arr_json, track_state); debug(bibliobuild) { writeln("- ", biblio_entry_str_json); writeln("-> ", biblio_arr_json.length); @@ -775,7 +795,7 @@ if there is a glossary section you need to: #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d } else if (line.matchFirst(rgx.heading_glossary) -|| (track["section"] == status.sect.glossary +|| (track_state["section"] == eN.sect.glossary && ((!(line.matchFirst(rgx.heading_biblio))) && (!(line.matchFirst(rgx.heading_blurb))) && (!(line.matchFirst(rgx.heading))) @@ -786,15 +806,15 @@ if there is a glossary section you need to: writeln(__LINE__); writeln(line); } - track["section"] = status.sect.glossary; + track_state["section"] = eN.sect.glossary; if (opt_action.backmatter && opt_action.section_glossary) { indent=[ "hang_position" : 0, "base_position" : 0, ]; bullet = false; - obj_type_status["para"] = State.on; - line_occur["para"] = State.off; + obj_type_status["para"] = eN.bi.on; + line_occur["para"] = eN.bi.off; an_object_key="glossary_nugget"; // if (line.matchFirst(rgx.heading_glossary)) { { @@ -883,13 +903,13 @@ if there is a blurb section you need to: #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d } else if (line.matchFirst(rgx.heading_blurb) -|| (track["section"] == status.sect.blurb +|| (track_state["section"] == eN.sect.blurb && ((!(line.matchFirst(rgx.heading_glossary))) && (!(line.matchFirst(rgx.heading_biblio))) && (!(line.matchFirst(rgx.heading))) && (!(line.matchFirst(rgx.comment))))) ) { - track["section"] = status.sect.blurb; + track_state["section"] = eN.sect.blurb; debug(blurb) { writeln(__LINE__); writeln(line); @@ -929,8 +949,8 @@ if there is a blurb section you need to: ]; bullet = true; } - obj_type_status["para"] = State.on; - line_occur["para"] = State.off; + obj_type_status["para"] = eN.bi.on; + line_occur["para"] = eN.bi.off; an_object_key="blurb_nugget"; if (line.matchFirst(rgx.heading_blurb)) { { @@ -1036,7 +1056,7 @@ if there is a blurb section you need to: #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -} else if (obj_type_status["quote"] == TriState.on) { /+ within block object: quote +/ +} else if (obj_type_status["quote"] == eN.tri.on) { /+ within block object: quote +/ line = line ._doc_header_and_make_substitutions_(conf_make_meta) ._doc_header_and_make_substitutions_fontface_(conf_make_meta); @@ -1049,7 +1069,7 @@ if there is a blurb section you need to: #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d /+ within block object: group +/ -} else if (obj_type_status["group"] == TriState.on) { /+ within block object: group +/ +} else if (obj_type_status["group"] == eN.tri.on) { /+ within block object: group +/ line = line ._doc_header_and_make_substitutions_(conf_make_meta) ._doc_header_and_make_substitutions_fontface_(conf_make_meta) @@ -1062,7 +1082,7 @@ if there is a blurb section you need to: #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -} else if (obj_type_status["block"] == TriState.on) { /+ within block object: block +/ +} else if (obj_type_status["block"] == eN.tri.on) { /+ within block object: block +/ line = line ._doc_header_and_make_substitutions_(conf_make_meta) ._doc_header_and_make_substitutions_fontface_(conf_make_meta); @@ -1078,7 +1098,7 @@ if there is a blurb section you need to: #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -} else if (obj_type_status["poem"] == TriState.on) { /+ within block object: poem +/ +} else if (obj_type_status["poem"] == eN.tri.on) { /+ within block object: poem +/ an_object = line.flow_txt_block_poem(an_object, obj_type_status, cntr, object_number_poem, conf_make_meta, tag_in_seg); continue; #+END_SRC @@ -1087,7 +1107,7 @@ if there is a blurb section you need to: #+NAME: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -} else if (obj_type_status["table"] == TriState.on) { /+ within block object: table +/ +} else if (obj_type_status["table"] == eN.tri.on) { /+ within block object: table +/ an_object = line.flow_txt_block_table(an_object, obj_type_status, conf_make_meta); continue; #+END_SRC @@ -1098,8 +1118,8 @@ if there is a blurb section you need to: #+NAME: abs_in_loop_body_open_block_obj_assert #+BEGIN_SRC d assert( - (obj_type_status["blocks"] == TriState.off) - || (obj_type_status["blocks"] == TriState.closing), + (obj_type_status["blocks"] == eN.tri.off) + || (obj_type_status["blocks"] == eN.tri.closing), "block status: none or closed" ); assertions_flag_types_block_status_none_or_closed(obj_type_status); @@ -1128,11 +1148,11 @@ assert( "line tested, line not empty surely:\n \"" ~ line ~ "\"" ); assert( - (obj_type_status["blocks"] == TriState.off) - || (obj_type_status["blocks"] == TriState.closing), + (obj_type_status["blocks"] == eN.tri.off) + || (obj_type_status["blocks"] == eN.tri.closing), "code block status: none or closed" ); -if (obj_type_status["blocks"] == TriState.closing) { +if (obj_type_status["blocks"] == eN.tri.closing) { debug(check) { writeln(__LINE__); writeln(line); @@ -1140,7 +1160,7 @@ if (obj_type_status["blocks"] == TriState.closing) { assert( line.matchFirst(rgx.book_index_item) || line.matchFirst(rgx.book_index_item_open) - || track["section"] == status.sect.book_index, + || track_state["section"] == eN.sect.book_index, "\nblocks closed, unless followed by book index, non-matching line:\n \"" ~ line ~ "\"" ); @@ -1153,8 +1173,8 @@ if (obj_type_status["blocks"] == TriState.closing) { #+BEGIN_SRC d if (line.matchFirst(rgx.book_index_item) || line.matchFirst(rgx.book_index_item_open) -|| track["section"] == status.sect.book_index) { /+ book_index +/ - an_object = line.flow_book_index_(an_object, book_idx_tmp, obj_type_status, track, opt_action); +|| track_state["section"] == eN.sect.book_index) { /+ book_index +/ + an_object = line.flow_book_index_(an_object, book_idx_tmp, obj_type_status, track_state, opt_action); #+END_SRC ******* not book index [+1] @@ -1190,19 +1210,19 @@ if (line.matchFirst(rgx.book_index_item) #+NAME: abs_in_loop_body_not_block_obj #+BEGIN_SRC d - } else if (((line_occur["para"] == State.off) - && (line_occur["heading"] == State.off)) - && ((obj_type_status["para"] == State.off) - && (obj_type_status["heading"] == State.off))) { /+ heading or para but neither flag nor line exists +/ + } else if (((line_occur["para"] == eN.bi.off) + && (line_occur["heading"] == eN.bi.off)) + && ((obj_type_status["para"] == eN.bi.off) + && (obj_type_status["heading"] == eN.bi.off))) { /+ heading or para but neither flag nor line exists +/ if ((conf_make_meta.make.headings.length > 2) - && (obj_type_status["make_headings"] == State.off)) { /+ heading found +/ + && (obj_type_status["make_headings"] == eN.bi.off)) { /+ heading found +/ heading_match_str = line.flow_heading_found_(heading_match_str, conf_make_meta.make.headings, heading_match_rgx, obj_type_status); } - if ((obj_type_status["make_headings"] == State.on) - && ((line_occur["para"] == State.off) - && (line_occur["heading"] == State.off)) - && ((obj_type_status["para"] == State.off) - && (obj_type_status["heading"] == State.off))) { /+ heading make set +/ + if ((obj_type_status["make_headings"] == eN.bi.on) + && ((line_occur["para"] == eN.bi.off) + && (line_occur["heading"] == eN.bi.off)) + && ((obj_type_status["para"] == eN.bi.off) + && (obj_type_status["heading"] == eN.bi.off))) { /+ heading make set +/ line = line.flow_heading_make_set_(line_occur, heading_match_rgx, obj_type_status); } /+ TODO node info: all headings identified at this point, @@ -1221,9 +1241,9 @@ if (line.matchFirst(rgx.book_index_item) collapsed_lev, obj_type_status, conf_make_meta, - track, + track_state, ); - } else if (line_occur["para"] == State.off) { /+ para match +/ + } else if (line_occur["para"] == eN.bi.off) { /+ para match +/ an_object_key="body_nugget"; line = line ._doc_header_and_make_substitutions_(conf_make_meta) @@ -1236,7 +1256,7 @@ if (line.matchFirst(rgx.book_index_item) #+NAME: abs_in_loop_body_not_block_obj #+BEGIN_SRC d - } else if (line_occur["heading"] > State.off) { /+ heading +/ + } else if (line_occur["heading"] > eN.bi.off) { /+ heading +/ debug(heading) { writeln(line); } @@ -1248,7 +1268,7 @@ if (line.matchFirst(rgx.book_index_item) #+NAME: abs_in_loop_body_not_block_obj #+BEGIN_SRC d - } else if (line_occur["para"] > State.off) { /+ paragraph +/ + } else if (line_occur["para"] > eN.bi.off) { /+ paragraph +/ debug(para) { writeln(an_object_key, "-> ", line); } @@ -1291,7 +1311,7 @@ assert( ~ line ~ "\"" ); assert( - (obj_type_status["blocks"] == State.off), + (obj_type_status["blocks"] == eN.bi.off), "code block status: none" ); #+END_SRC @@ -1305,8 +1325,8 @@ if (_new_doc) { lv0_to_3_tags = lv0_to_3_tags.init; tag_in_seg = tag_in_seg.init; } -if ((obj_type_status["heading"] == State.on) -&& (line_occur["heading"] > State.off)) { /+ heading object (current line empty) +/ +if ((obj_type_status["heading"] == eN.bi.on) +&& (line_occur["heading"] > eN.bi.off)) { /+ heading object (current line empty) +/ obj_cite_digits = (an_object["lev_markup_number"].to!int == 0) ? ocn_emit(OCNstatus.reset) : ocn_emit(obj_type_status["ocn_status"]); @@ -1433,8 +1453,8 @@ if ((obj_type_status["heading"] == State.on) #+NAME: abs_in_loop_body_not_block_obj_line_empty #+BEGIN_SRC d -} else if ((obj_type_status["para"] == State.on) -&& (line_occur["para"] > State.off)) { +} else if ((obj_type_status["para"] == eN.bi.on) +&& (line_occur["para"] > eN.bi.off)) { /+ paragraph object (current line empty) +/ /+ repeated character paragraph separator +/ if ((an_object[an_object_key].to!string).matchFirst(rgx.repeated_character_line_separator)) { @@ -1512,7 +1532,7 @@ if (the_document_body_section.length > 0) { && (the_document_body_section.length > previous_length)) { if ((the_document_body_section[$-1].metainfo.is_a == "heading") && (the_document_body_section[$-1].metainfo.heading_lev_markup < 5)) { - track["section"] = status.sect.unset; + track_state["section"] = eN.sect.unset; } if (the_document_body_section[$-1].metainfo.is_a == "verse") { /+ scan for endnotes for whole poem (each verse in poem) +/ foreach (i; previous_length .. the_document_body_section.length) { @@ -3134,10 +3154,10 @@ functions used in document abstraction return ref string[string] an_object, return ref int[string] obj_type_status, ) { - line_occur["heading"] = State.off; - line_occur["para"] = State.off; - obj_type_status["heading"] = State.off; - obj_type_status["para"] = State.off; + line_occur["heading"] = eN.bi.off; + line_occur["para"] = eN.bi.off; + obj_type_status["heading"] = eN.bi.off; + obj_type_status["para"] = eN.bi.off; an_object = an_object.object_reset; } #+END_SRC @@ -3165,7 +3185,7 @@ functions used in document abstraction } if (line.matchFirst(rgx.object_number_off_block_dummy_heading)) { obj_type_status["ocn_status_off_for_multiple_objects"] = OCN_off_block_status.on; - obj_type_status["heading_off_for_multiple_objects"] = Status.on; + obj_type_status["heading_off_for_multiple_objects"] = eN.bi.on; obj_type_status["ocn_status"] = OCNstatus.off; debug(ocnoff) { writeln(line); @@ -3173,18 +3193,18 @@ functions used in document abstraction } } else { if (obj_type_status["ocn_status_off_for_multiple_objects"] == OCN_off_block_status.off) { - obj_type_status["dummy_heading_status"] = Status.off; + obj_type_status["dummy_heading_status"] = eN.bi.off; if (obj_type_status["heading_off_for_multiple_objects"]) { - obj_type_status["dummy_heading_status"] = Status.on; + obj_type_status["dummy_heading_status"] = eN.bi.on; } if (line.matchFirst(rgx.object_number_off)) { obj_type_status["ocn_status"] = OCNstatus.off; } else if (line.matchFirst(rgx.object_number_off_dummy_heading)) { obj_type_status["ocn_status"] = OCNstatus.off; - obj_type_status["dummy_heading_status"] = Status.on; + obj_type_status["dummy_heading_status"] = eN.bi.on; } else { obj_type_status["ocn_status"] = OCNstatus.on; - obj_type_status["dummy_heading_status"] = Status.off; + obj_type_status["dummy_heading_status"] = eN.bi.off; } } else { obj_type_status["ocn_status"] = obj_type_status["ocn_status_off_for_multiple_objects"]; @@ -3197,7 +3217,7 @@ functions used in document abstraction if (line.matchFirst(rgx.object_number_off_block_close)) { obj_type_status["ocn_status_off_for_multiple_objects"] = OCN_off_block_status.off; obj_type_status["ocn_status"] = OCNstatus.on; - obj_type_status["dummy_heading_status"] = Status.off; + obj_type_status["dummy_heading_status"] = eN.bi.off; debug(ocnoff) { writeln(line); } @@ -3296,9 +3316,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["code"] = TriState.on; - obj_type_status["curly_code"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["code"] = eN.tri.on; + obj_type_status["curly_code"] = eN.tri.on; #+END_SRC ******* poem @@ -3317,10 +3337,10 @@ functions used in document abstraction ); } object_number_poem["start"] = obj_cite_digits.object_number.to!string; - 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; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["verse_new"] = eN.bi.on; + obj_type_status["poem"] = eN.tri.on; + obj_type_status["curly_poem"] = eN.tri.on; #+END_SRC ******* group @@ -3338,9 +3358,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["group"] = TriState.on; - obj_type_status["curly_group"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["group"] = eN.tri.on; + obj_type_status["curly_group"] = eN.tri.on; #+END_SRC ******* block @@ -3358,9 +3378,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["block"] = TriState.on; - obj_type_status["curly_block"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["block"] = eN.tri.on; + obj_type_status["curly_block"] = eN.tri.on; #+END_SRC ******* quote @@ -3378,9 +3398,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["quote"] = TriState.on; - obj_type_status["curly_quote"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["quote"] = eN.tri.on; + obj_type_status["curly_quote"] = eN.tri.on; #+END_SRC ******* table @@ -3397,9 +3417,9 @@ functions used in document abstraction dochas["table"] ++; an_object["table_head"] = m["attrib"].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; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["table"] = eN.tri.on; + obj_type_status["curly_table"] = eN.tri.on; #+END_SRC ******* table special @@ -3410,9 +3430,9 @@ functions used in document abstraction dochas["table"]++; an_object["table_head"] = m["attrib"].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; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["table"] = eN.tri.on; + obj_type_status["curly_table_special_markup"] = eN.tri.on; #+END_SRC ****** block (various) tic open :tic: @@ -3431,9 +3451,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["code"] = TriState.on; - obj_type_status["tic_code"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["code"] = eN.tri.on; + obj_type_status["tic_code"] = eN.tri.on; #+END_SRC ******* poem @@ -3452,10 +3472,10 @@ functions used in document abstraction ); } object_number_poem["start"] = obj_cite_digits.object_number.to!string; - 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; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["verse_new"] = eN.bi.on; + obj_type_status["poem"] = eN.tri.on; + obj_type_status["tic_poem"] = eN.tri.on; #+END_SRC ******* group @@ -3473,9 +3493,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["group"] = TriState.on; - obj_type_status["tic_group"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["group"] = eN.tri.on; + obj_type_status["tic_group"] = eN.tri.on; #+END_SRC ******* block @@ -3493,9 +3513,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["block"] = TriState.on; - obj_type_status["tic_block"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["block"] = eN.tri.on; + obj_type_status["tic_block"] = eN.tri.on; #+END_SRC ******* quote @@ -3513,9 +3533,9 @@ functions used in document abstraction line ); } - obj_type_status["blocks"] = TriState.on; - obj_type_status["quote"] = TriState.on; - obj_type_status["tic_quote"] = TriState.on; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["quote"] = eN.tri.on; + obj_type_status["tic_quote"] = eN.tri.on; #+END_SRC ******* table @@ -3532,9 +3552,9 @@ functions used in document abstraction dochas["table"] ++; an_object["table_head"] = m["attrib"].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; + obj_type_status["blocks"] = eN.tri.on; + obj_type_status["table"] = eN.tri.on; + obj_type_status["tic_table"] = eN.tri.on; } #+END_SRC @@ -3556,7 +3576,7 @@ functions used in document abstraction return ref int[string] obj_type_status ) { static auto rgx = RgxI(); - if (obj_type_status["curly_code"] == TriState.on) { + if (obj_type_status["curly_code"] == eN.tri.on) { if (line.matchFirst(rgx.block_curly_code_close)) { debug(codecurly) { // code (curly) close writeln(line); @@ -3564,16 +3584,16 @@ functions used in document abstraction an_object[an_object_key] = an_object[an_object_key] .replaceFirst(rgx.newline_eol_delimiter_only, "") .stripRight; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["code"] = TriState.closing; - obj_type_status["curly_code"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["code"] = eN.tri.closing; + obj_type_status["curly_code"] = eN.tri.off; } else { debug(codecurly) { // code (curly) line writeln(line); } an_object[an_object_key] ~= line ~= "\n"; // code (curly) line } - } else if (obj_type_status["tic_code"] == TriState.on) { + } else if (obj_type_status["tic_code"] == eN.tri.on) { if (line.matchFirst(rgx.block_tic_close)) { debug(codetic) { // code (tic) close writeln(line); @@ -3581,9 +3601,9 @@ functions used in document abstraction an_object[an_object_key] = an_object[an_object_key] .replaceFirst(rgx.newline_eol_delimiter_only, "") .stripRight; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["code"] = TriState.closing; - obj_type_status["tic_code"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["code"] = eN.tri.closing; + obj_type_status["tic_code"] = eN.tri.off; } else { debug(codetic) { // code (tic) line writeln(line); @@ -3657,14 +3677,13 @@ final string biblio_tag_map_()(string abr) { return ref int bib_entry, return ref string biblio_entry_str_json, return ref string[] biblio_arr_json, - return ref int[string] track, + return ref int[string] track_state, ) { mixin spineBiblio; - mixin spineDocStatus; auto jsn = BibJsnStr(); static auto rgx = RgxI(); if (line.matchFirst(rgx.heading_biblio)) { - track["section"] = status.sect.bibliography; + track_state["section"] = eN.sect.bibliography; } if (line.empty) { debug { @@ -3675,12 +3694,12 @@ final string biblio_tag_map_()(string abr) { writeln(biblio_entry_str_json.length); } } - if ((bib_entry == State.off) + if ((bib_entry == eN.bi.off) && (biblio_entry_str_json.empty)) { - bib_entry = State.on; + bib_entry = eN.bi.on; biblio_entry_str_json = jsn.biblio_entry_tags_jsonstr; } else if (!(biblio_entry_str_json.empty)) { - bib_entry = State.off; + bib_entry = eN.bi.off; if (!(biblio_entry_str_json == jsn.biblio_entry_tags_jsonstr)) { auto biblio_entry = parseJSON(biblio_entry_str_json); if (biblio_entry["fulltitle"].str.empty) { @@ -3701,7 +3720,7 @@ final string biblio_tag_map_()(string abr) { writeln(line); } auto bt = line.match(rgx.biblio_tags); - bib_entry = State.off; + bib_entry = eN.bi.off; st = bt.captures[1].to!string; auto header_tag_value=(bt.captures[2]).to!string; JSONValue j = parseJSON(biblio_entry_str_json); @@ -3785,30 +3804,30 @@ final string biblio_tag_map_()(string abr) { return ref int[string] obj_type_status ) { static auto rgx = RgxI(); - if (obj_type_status["curly_quote"] == TriState.on) { + if (obj_type_status["curly_quote"] == eN.tri.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; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["quote"] = TriState.closing; - obj_type_status["curly_quote"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["quote"] = eN.tri.closing; + obj_type_status["curly_quote"] = eN.tri.off; } else { debug(quote) { writeln(line); } an_object[an_object_key] ~= line ~= "\n"; // build quote array (or string) } - } else if (obj_type_status["tic_quote"] == TriState.on) { + } else if (obj_type_status["tic_quote"] == eN.tri.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; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["quote"] = TriState.closing; - obj_type_status["tic_quote"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["quote"] = eN.tri.closing; + obj_type_status["tic_quote"] = eN.tri.off; } else { debug(quote) { writeln(line); @@ -3833,30 +3852,30 @@ final string biblio_tag_map_()(string abr) { return ref int[string] obj_type_status ) { static auto rgx = RgxI(); - if (obj_type_status["curly_group"] == State.on) { + if (obj_type_status["curly_group"] == eN.bi.on) { if (line.matchFirst(rgx.block_curly_group_close)) { debug(group) { writeln(line); } an_object[an_object_key] = an_object[an_object_key].stripRight; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["group"] = TriState.closing; - obj_type_status["curly_group"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["group"] = eN.tri.closing; + obj_type_status["curly_group"] = eN.tri.off; } else { debug(group) { writeln(line); } an_object[an_object_key] ~= line ~= "\n"; // build group array (or string) } - } else if (obj_type_status["tic_group"] == TriState.on) { + } else if (obj_type_status["tic_group"] == eN.tri.on) { if (line.matchFirst(rgx.block_tic_close)) { debug(group) { writeln(line); } an_object[an_object_key] = an_object[an_object_key].stripRight; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["group"] = TriState.closing; - obj_type_status["tic_group"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["group"] = eN.tri.closing; + obj_type_status["tic_group"] = eN.tri.off; } else { debug(group) { writeln(line); @@ -3882,30 +3901,30 @@ final string biblio_tag_map_()(string abr) { return ref int[string] obj_type_status ) { static auto rgx = RgxI(); - if (obj_type_status["curly_block"] == TriState.on) { + if (obj_type_status["curly_block"] == eN.tri.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; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["block"] = TriState.closing; - obj_type_status["curly_block"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["block"] = eN.tri.closing; + obj_type_status["curly_block"] = eN.tri.off; } else { debug(block) { writeln(line); } an_object[an_object_key] ~= line ~= "\n"; // build block array (or string) } - } else if (obj_type_status["tic_block"] == TriState.on) { + } else if (obj_type_status["tic_block"] == eN.tri.on) { if (line.matchFirst(rgx.block_tic_close)) { debug(block) { writeln(line); } an_object[an_object_key] = an_object[an_object_key].stripRight; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["block"] = TriState.closing; - obj_type_status["tic_block"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["block"] = eN.tri.closing; + obj_type_status["tic_block"] = eN.tri.off; } else { debug(block) { writeln(line); @@ -3933,7 +3952,7 @@ why extra object stuff only in poem/verse? string[string] tag_in_seg, ) { static auto rgx = RgxI(); - if (obj_type_status["curly_poem"] == TriState.on) { + if (obj_type_status["curly_poem"] == eN.tri.on) { if (line.matchFirst(rgx.block_curly_poem_close)) { if (an_object_key in an_object || processing.length > 0) { @@ -3991,20 +4010,20 @@ why extra object stuff only in poem/verse? ++cntr; } object_number_poem["end"] = obj_cite_digits.object_number.to!string; - obj_type_status["blocks"] = TriState.closing; - obj_type_status["poem"] = TriState.closing; - obj_type_status["curly_poem"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["poem"] = eN.tri.closing; + obj_type_status["curly_poem"] = eN.tri.off; } else { processing["verse"] ~= line ~= "\n"; - if (obj_type_status["verse_new"] == State.on) { + if (obj_type_status["verse_new"] == eN.bi.on) { obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); - obj_type_status["verse_new"] = State.off; + obj_type_status["verse_new"] = eN.bi.off; } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) { processing["verse"] = processing["verse"].stripRight; - verse_line = TriState.off; - obj_type_status["verse_new"] = State.on; + verse_line = eN.tri.off; + obj_type_status["verse_new"] = eN.bi.on; } - if (obj_type_status["verse_new"] == State.on) { + if (obj_type_status["verse_new"] == eN.bi.on) { verse_line=1; an_object[an_object_key] = processing["verse"]; debug(poem) { // poem verse @@ -4053,7 +4072,7 @@ why extra object stuff only in poem/verse? ++cntr; } } - } else if (obj_type_status["tic_poem"] == TriState.on) { + } else if (obj_type_status["tic_poem"] == eN.tri.on) { if (auto m = line.matchFirst(rgx.block_tic_close)) { // tic_poem_close an_object[an_object_key]="verse"; debug(poem) { @@ -4099,20 +4118,20 @@ why extra object stuff only in poem/verse? processing.remove("verse"); ++cntr; } - obj_type_status["blocks"] = TriState.closing; - obj_type_status["poem"] = TriState.closing; - obj_type_status["tic_poem"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["poem"] = eN.tri.closing; + obj_type_status["tic_poem"] = eN.tri.off; } else { processing["verse"] ~= line ~= "\n"; - if (obj_type_status["verse_new"] == State.on) { + if (obj_type_status["verse_new"] == eN.bi.on) { obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); - obj_type_status["verse_new"] = State.off; + obj_type_status["verse_new"] = eN.bi.off; } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) { processing["verse"] = processing["verse"].stripRight; - obj_type_status["verse_new"] = State.on; - verse_line = TriState.off; + obj_type_status["verse_new"] = eN.bi.on; + verse_line = eN.tri.off; } - if (obj_type_status["verse_new"] == State.on) { + if (obj_type_status["verse_new"] == eN.bi.on) { verse_line=1; an_object[an_object_key] = processing["verse"]; debug(poem) { // poem (tic) close @@ -4194,25 +4213,25 @@ you need: return ref CMM conf_make_meta, ) { static auto rgx = RgxI(); - if (obj_type_status["curly_table"] == TriState.on) { + if (obj_type_status["curly_table"] == eN.tri.on) { if (line.matchFirst(rgx.block_curly_table_close)) { debug(table) { // table (curly) close writeln(line); } - obj_type_status["blocks"] = TriState.closing; - obj_type_status["table"] = TriState.closing; - obj_type_status["curly_table"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["table"] = eN.tri.closing; + obj_type_status["curly_table"] = eN.tri.off; } else { debug(table) { // table writeln(line); } an_object[an_object_key] ~= line ~= "\n"; // build table array (or string) } - } else if (obj_type_status["curly_table_special_markup"] == TriState.on) { + } else if (obj_type_status["curly_table_special_markup"] == eN.tri.on) { if (line.empty) { - obj_type_status["blocks"] = TriState.off; - obj_type_status["table"] = TriState.off; - obj_type_status["curly_table_special_markup"] = TriState.off; + obj_type_status["blocks"] = eN.tri.off; + obj_type_status["table"] = eN.tri.off; + obj_type_status["curly_table_special_markup"] = eN.tri.off; line.flow_table_closed_make_special_notation_table_( an_object, the_document_body_section, @@ -4228,14 +4247,14 @@ you need: } an_object[an_object_key] ~= line ~= "\n"; } - } else if (obj_type_status["tic_table"] == TriState.on) { + } else if (obj_type_status["tic_table"] == eN.tri.on) { if (line.matchFirst(rgx.block_tic_close)) { debug(table) { // table (tic) close writeln(line); } - obj_type_status["blocks"] = TriState.closing; - obj_type_status["table"] = TriState.closing; - obj_type_status["tic_table"] = TriState.off; + obj_type_status["blocks"] = eN.tri.closing; + obj_type_status["table"] = eN.tri.closing; + obj_type_status["tic_table"] = eN.tri.off; } else { debug(table) { // table writeln(line); @@ -4326,7 +4345,7 @@ process and use an_object["table_head"] (then empty it) ~ line ~ "\"" ); assert( - (obj_type_status["blocks"] == TriState.closing), + (obj_type_status["blocks"] == eN.tri.closing), "code block status: closed" ); assertions_flag_types_block_status_none_or_closed(obj_type_status); @@ -4337,7 +4356,7 @@ process and use an_object["table_head"] (then empty it) #+NAME: abs_functions_block_line_status_empty #+BEGIN_SRC d - if (obj_type_status["quote"] == TriState.closing) { + if (obj_type_status["quote"] == eN.tri.closing) { obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; @@ -4383,8 +4402,8 @@ process and use an_object["table_head"] (then empty it) comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); - obj_type_status["blocks"] = TriState.off; - obj_type_status["quote"] = TriState.off; + obj_type_status["blocks"] = eN.tri.off; + obj_type_status["quote"] = eN.tri.off; object_reset(an_object); processing.remove("verse"); ++cntr; @@ -4394,7 +4413,7 @@ process and use an_object["table_head"] (then empty it) #+NAME: abs_functions_block_line_status_empty #+BEGIN_SRC d - } else if (obj_type_status["group"] == TriState.closing) { + } else if (obj_type_status["group"] == eN.tri.closing) { obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; @@ -4440,8 +4459,8 @@ process and use an_object["table_head"] (then empty it) comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); - obj_type_status["blocks"] = TriState.off; - obj_type_status["group"] = TriState.off; + obj_type_status["blocks"] = eN.tri.off; + obj_type_status["group"] = eN.tri.off; object_reset(an_object); processing.remove("verse"); ++cntr; @@ -4451,7 +4470,7 @@ process and use an_object["table_head"] (then empty it) #+NAME: abs_functions_block_line_status_empty #+BEGIN_SRC d - } else if (obj_type_status["block"] == TriState.closing) { + } else if (obj_type_status["block"] == eN.tri.closing) { obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; @@ -4496,8 +4515,8 @@ process and use an_object["table_head"] (then empty it) comp_obj_block.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; comp_obj_block.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_block; - obj_type_status["blocks"] = TriState.off; - obj_type_status["block"] = TriState.off; + obj_type_status["blocks"] = eN.tri.off; + obj_type_status["block"] = eN.tri.off; object_reset(an_object); processing.remove("verse"); ++cntr; @@ -4507,7 +4526,7 @@ process and use an_object["table_head"] (then empty it) #+NAME: abs_functions_block_line_status_empty #+BEGIN_SRC d - } else if (obj_type_status["poem"] == TriState.closing) { + } else if (obj_type_status["poem"] == eN.tri.closing) { an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes @@ -4540,8 +4559,8 @@ process and use an_object["table_head"] (then empty it) comp_obj_poem_ocn.metainfo.object_number_type = obj_cite_digits.type; comp_obj_poem_ocn.text = ""; the_document_body_section ~= comp_obj_poem_ocn; - obj_type_status["blocks"] = TriState.off; - obj_type_status["poem"] = TriState.off; + obj_type_status["blocks"] = eN.tri.off; + obj_type_status["poem"] = eN.tri.off; object_reset(an_object); processing.remove("verse"); #+END_SRC @@ -4550,7 +4569,7 @@ process and use an_object["table_head"] (then empty it) #+NAME: abs_functions_block_line_status_empty #+BEGIN_SRC d - } else if (obj_type_status["code"] == TriState.closing) { + } else if (obj_type_status["code"] == eN.tri.closing) { obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; @@ -4596,8 +4615,8 @@ process and use an_object["table_head"] (then empty it) comp_obj_code.has.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; comp_obj_code.has.inline_links = substantive_obj_misc_tuple[sObj.links]; the_document_body_section ~= comp_obj_code; - obj_type_status["blocks"] = TriState.off; - obj_type_status["code"] = TriState.off; + obj_type_status["blocks"] = eN.tri.off; + obj_type_status["code"] = eN.tri.off; object_reset(an_object); processing.remove("verse"); ++cntr; @@ -4607,7 +4626,7 @@ process and use an_object["table_head"] (then empty it) #+NAME: abs_functions_block_line_status_empty #+BEGIN_SRC d - } else if (obj_type_status["table"] == TriState.closing) { + } else if (obj_type_status["table"] == eN.tri.closing) { comp_obj_block = comp_obj_block.init; obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); an_object["bookindex_nugget"] @@ -4644,8 +4663,8 @@ process and use an_object["table_head"] (then empty it) comp_obj_block = comp_obj_block.flow_table_instructions(an_object["table_head"]); comp_obj_block = comp_obj_block.flow_table_substantive_munge(an_object["substantive"]); the_document_body_section ~= comp_obj_block; - obj_type_status["blocks"] = TriState.off; - obj_type_status["table"] = TriState.off; + obj_type_status["blocks"] = eN.tri.off; + obj_type_status["table"] = eN.tri.off; object_reset(an_object); processing.remove("verse"); ++cntr; @@ -4669,10 +4688,9 @@ process and use an_object["table_head"] (then empty it) string[string] an_object, return ref string book_idx_tmp, return ref int[string] obj_type_status, - return ref int[string] track, + return ref int[string] track_state, B opt_action, ) { - mixin spineDocStatus; static auto rgx = RgxI(); if (auto m = line.match(rgx.book_index_item)) { /+ match book_index +/ debug(bookindexmatch) { @@ -4683,7 +4701,7 @@ process and use an_object["table_head"] (then empty it) } an_object["bookindex_nugget"] = m.captures[1].to!string; } else if (auto m = line.match(rgx.book_index_item_open)) { /+ match open book_index +/ - track["section"] = status.sect.book_index; + track_state["section"] = eN.sect.book_index; if (opt_action.backmatter && opt_action.section_bookindex) { book_idx_tmp = m.captures[1].to!string; debug(bookindexmatch) { @@ -4693,9 +4711,9 @@ process and use an_object["table_head"] (then empty it) ); } } - } else if (track["section"] == status.sect.book_index) { /+ book_index flag set +/ + } else if (track_state["section"] == eN.sect.book_index) { /+ book_index flag set +/ if (auto m = line.match(rgx.book_index_item_close)) { - track["section"] = status.sect.unset; + track_state["section"] = eN.sect.unset; if (opt_action.backmatter && opt_action.section_bookindex) { an_object["bookindex_nugget"] = book_idx_tmp ~ m.captures[1].to!string; @@ -4732,7 +4750,7 @@ process and use an_object["table_head"] (then empty it) ) { static auto rgx = RgxI(); if ((_make_unmarked_headings.length > 2) - && (obj_type_status["make_headings"] == State.off)) { /+ headings found +/ + && (obj_type_status["make_headings"] == eN.bi.off)) { /+ headings found +/ debug(headingsfound) { writeln(_make_unmarked_headings); } @@ -4800,7 +4818,7 @@ process and use an_object["table_head"] (then empty it) default: break; } - obj_type_status["make_headings"] = State.on; + obj_type_status["make_headings"] = eN.bi.on; } return heading_match_str; } @@ -4816,11 +4834,11 @@ process and use an_object["table_head"] (then empty it) return ref Regex!(char)[string] heading_match_rgx, return ref int[string] obj_type_status ) { - if ((obj_type_status["make_headings"] == State.on) - && ((line_occur["para"] == State.off) - && (line_occur["heading"] == State.off)) - && ((obj_type_status["para"] == State.off) - && (obj_type_status["heading"] == State.off))) { /+ heading make set +/ + if ((obj_type_status["make_headings"] == eN.bi.on) + && ((line_occur["para"] == eN.bi.off) + && (line_occur["heading"] == eN.bi.off)) + && ((obj_type_status["para"] == eN.bi.off) + && (obj_type_status["heading"] == eN.bi.off))) { /+ heading make set +/ if (line.matchFirst(heading_match_rgx["h_B"])) { line = "B~ " ~ line; debug(headingsfound) { @@ -4881,16 +4899,15 @@ process and use an_object["table_head"] (then empty it) return ref int[string] collapsed_lev, return ref int[string] obj_type_status, return ref CMM conf_make_meta, - return ref int[string] track, + return ref int[string] track_state, ) { - mixin spineDocStatus; static auto rgx = RgxI(); if (auto m = line.match(rgx.headings)) { /+ heading match +/ ++line_occur["heading"]; - obj_type_status["heading"] = State.on; - obj_type_status["para"] = State.off; + obj_type_status["heading"] = eN.bi.on; + obj_type_status["para"] = eN.bi.off; if (line.match(rgx.heading_seg_and_above)) { - track["section"] = status.sect.unset; + track_state["section"] = eN.sect.unset; } an_object[an_object_key] ~= line ~= "\n"; an_object["lev"] ~= m.captures[1]; @@ -4914,13 +4931,13 @@ process and use an_object["table_head"] (then empty it) = collapsed_lev["h0"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_A; ++lv["h0"]; - lv["h1"] = State.off; - lv["h2"] = State.off; - lv["h3"] = State.off; - lv["h4"] = State.off; - lv["h5"] = State.off; - lv["h6"] = State.off; - lv["h7"] = State.off; + lv["h1"] = eN.bi.off; + lv["h2"] = eN.bi.off; + lv["h3"] = eN.bi.off; + lv["h4"] = eN.bi.off; + lv["h5"] = eN.bi.off; + lv["h6"] = eN.bi.off; + lv["h7"] = eN.bi.off; goto default; case "B": collapsed_lev["h1"] = collapsed_lev["h0"] + 1; @@ -4928,12 +4945,12 @@ process and use an_object["table_head"] (then empty it) = collapsed_lev["h1"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_B; ++lv["h1"]; - lv["h2"] = State.off; - lv["h3"] = State.off; - lv["h4"] = State.off; - lv["h5"] = State.off; - lv["h6"] = State.off; - lv["h7"] = State.off; + lv["h2"] = eN.bi.off; + lv["h3"] = eN.bi.off; + lv["h4"] = eN.bi.off; + lv["h5"] = eN.bi.off; + lv["h6"] = eN.bi.off; + lv["h7"] = eN.bi.off; goto default; case "C": collapsed_lev["h2"] = collapsed_lev["h1"] + 1; @@ -4941,11 +4958,11 @@ process and use an_object["table_head"] (then empty it) = collapsed_lev["h2"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_C; ++lv["h2"]; - lv["h3"] = State.off; - lv["h4"] = State.off; - lv["h5"] = State.off; - lv["h6"] = State.off; - lv["h7"] = State.off; + lv["h3"] = eN.bi.off; + lv["h4"] = eN.bi.off; + lv["h5"] = eN.bi.off; + lv["h6"] = eN.bi.off; + lv["h7"] = eN.bi.off; goto default; case "D": collapsed_lev["h3"] = collapsed_lev["h2"] + 1; @@ -4953,61 +4970,61 @@ process and use an_object["table_head"] (then empty it) = collapsed_lev["h3"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_D; ++lv["h3"]; - lv["h4"] = State.off; - lv["h5"] = State.off; - lv["h6"] = State.off; - lv["h7"] = State.off; + lv["h4"] = eN.bi.off; + lv["h5"] = eN.bi.off; + lv["h6"] = eN.bi.off; + lv["h7"] = eN.bi.off; goto default; case "1": - if (lv["h3"] > State.off) { + if (lv["h3"] > eN.bi.off) { collapsed_lev["h4"] = collapsed_lev["h3"] + 1; - } else if (lv["h2"] > State.off) { + } else if (lv["h2"] > eN.bi.off) { collapsed_lev["h4"] = collapsed_lev["h2"] + 1; - } else if (lv["h1"] > State.off) { + } else if (lv["h1"] > eN.bi.off) { collapsed_lev["h4"] = collapsed_lev["h1"] + 1; - } else if (lv["h0"] > State.off) { + } else if (lv["h0"] > eN.bi.off) { collapsed_lev["h4"] = collapsed_lev["h0"] + 1; } an_object["lev_collapsed_number"] = collapsed_lev["h4"].to!string; lv["lv"] = DocStructMarkupHeading.h_text_1; ++lv["h4"]; - lv["h5"] = State.off; - lv["h6"] = State.off; - lv["h7"] = State.off; + lv["h5"] = eN.bi.off; + lv["h6"] = eN.bi.off; + lv["h7"] = eN.bi.off; goto default; case "2": - if (lv["h5"] > State.off) { + if (lv["h5"] > eN.bi.off) { an_object["lev_collapsed_number"] = collapsed_lev["h5"].to!string; - } else if (lv["h4"] > State.off) { + } else if (lv["h4"] > eN.bi.off) { collapsed_lev["h5"] = collapsed_lev["h4"] + 1; an_object["lev_collapsed_number"] = collapsed_lev["h5"].to!string; } lv["lv"] = DocStructMarkupHeading.h_text_2; ++lv["h5"]; - lv["h6"] = State.off; - lv["h7"] = State.off; + lv["h6"] = eN.bi.off; + lv["h7"] = eN.bi.off; goto default; case "3": - if (lv["h6"] > State.off) { + if (lv["h6"] > eN.bi.off) { an_object["lev_collapsed_number"] = collapsed_lev["h6"].to!string; - } else if (lv["h5"] > State.off) { + } else if (lv["h5"] > eN.bi.off) { collapsed_lev["h6"] = collapsed_lev["h5"] + 1; an_object["lev_collapsed_number"] = collapsed_lev["h6"].to!string; } lv["lv"] = DocStructMarkupHeading.h_text_3; ++lv["h6"]; - lv["h7"] = State.off; + lv["h7"] = eN.bi.off; goto default; case "4": - if (lv["h7"] > State.off) { + if (lv["h7"] > eN.bi.off) { an_object["lev_collapsed_number"] = collapsed_lev["h7"].to!string; - } else if (lv["h6"] > State.off) { + } else if (lv["h6"] > eN.bi.off) { collapsed_lev["h7"] = collapsed_lev["h6"] + 1; an_object["lev_collapsed_number"] = collapsed_lev["h7"].to!string; @@ -5018,7 +5035,7 @@ process and use an_object["table_head"] (then empty it) default: an_object["lev_markup_number"] = lv["lv"].to!string; } - an_object["dummy_heading_status"] = (obj_type_status["dummy_heading_status"] == State.off) ? "f" : "t"; + an_object["dummy_heading_status"] = (obj_type_status["dummy_heading_status"] == eN.bi.off) ? "f" : "t"; debug(heading) { writeln(line.strip); } @@ -5041,10 +5058,10 @@ process and use an_object["table_head"] (then empty it) return ref int[string] line_occur, ) { static auto rgx = RgxI(); - if (line_occur["para"] == State.off) { + if (line_occur["para"] == eN.bi.off) { line = font_faces_line(line); /+ para matches +/ - obj_type_status["para"] = State.on; + obj_type_status["para"] = eN.bi.on; an_object[an_object_key] ~= line; indent=[ "hang_position" : 0, @@ -7171,13 +7188,13 @@ struct NodeStructureMetadata { assert(obj_cite_digits.object_number.to!int >= 0); assert(is_ != "heading"); // should not be necessary assert(obj_cite_digits.object_number.to!int >= 0); // should not be necessary - if (lv7 > State.off) { + if (lv7 > eN.bi.off) { p_["lev_markup_number"] = DocStructMarkupHeading.h_text_4; p_["object_number"] = lv7; - } else if (lv6 > State.off) { + } else if (lv6 > eN.bi.off) { p_["lev_markup_number"] = DocStructMarkupHeading.h_text_3; p_["object_number"] = lv6; - } else if (lv5 > State.off) { + } else if (lv5 > eN.bi.off) { p_["lev_markup_number"] = DocStructMarkupHeading.h_text_2; p_["object_number"] = lv5; } else { @@ -7290,15 +7307,15 @@ struct NodeStructureMetadata { lv = DocStructMarkupHeading.h_text_1; lv4 = obj_cite_digit; lv5=0; lv6=0; lv7=0; - if (lv3 > State.off) { + if (lv3 > eN.bi.off) { p_["lev_markup_number"] = DocStructMarkupHeading.h_sect_D; p_["object_number"] = lv3; - } else if (lv2 > State.off) { + } else if (lv2 > eN.bi.off) { p_["lev_markup_number"] = DocStructMarkupHeading.h_sect_C; p_["object_number"] = lv2; - } else if (lv1 > State.off) { + } else if (lv1 > eN.bi.off) { p_["lev_markup_number"] = DocStructMarkupHeading.h_sect_B; p_["object_number"] = lv1; @@ -7428,171 +7445,171 @@ struct NodeStructureMetadata { string[string] an_object, int[string] lv ) { - if (lv["h3"] > State.off) { - assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); - assert(lv["h2"] > State.off); - } else if (lv["h2"] > State.off) { - assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); - assert(lv["h3"] == State.off); - } else if (lv["h1"] > State.off) { - assert(lv["h0"] > State.off); - assert(lv["h2"] == State.off); - assert(lv["h3"] == State.off); - } else if (lv["h0"] > State.off) { - assert(lv["h1"] == State.off); - assert(lv["h2"] == State.off); - assert(lv["h3"] == State.off); + if (lv["h3"] > eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h1"] > eN.bi.off); + assert(lv["h2"] > eN.bi.off); + } else if (lv["h2"] > eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h1"] > eN.bi.off); + assert(lv["h3"] == eN.bi.off); + } else if (lv["h1"] > eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h2"] == eN.bi.off); + assert(lv["h3"] == eN.bi.off); + } else if (lv["h0"] > eN.bi.off) { + assert(lv["h1"] == eN.bi.off); + assert(lv["h2"] == eN.bi.off); + assert(lv["h3"] == eN.bi.off); } else { - assert(lv["h0"] == State.off); - assert(lv["h1"] == State.off); - assert(lv["h2"] == State.off); - assert(lv["h3"] == State.off); - } - if (lv["h7"] > State.off) { - assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); - assert(lv["h6"] > State.off); - } else if (lv["h6"] > State.off) { - assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); - assert(lv["h7"] == State.off); - } else if (lv["h5"] > State.off) { - assert(lv["h4"] > State.off); - assert(lv["h6"] == State.off); - assert(lv["h7"] == State.off); - } else if (lv["h4"] > State.off) { - assert(lv["h5"] == State.off); - assert(lv["h6"] == State.off); - assert(lv["h7"] == State.off); + assert(lv["h0"] == eN.bi.off); + assert(lv["h1"] == eN.bi.off); + assert(lv["h2"] == eN.bi.off); + assert(lv["h3"] == eN.bi.off); + } + if (lv["h7"] > eN.bi.off) { + assert(lv["h4"] > eN.bi.off); + assert(lv["h5"] > eN.bi.off); + assert(lv["h6"] > eN.bi.off); + } else if (lv["h6"] > eN.bi.off) { + assert(lv["h4"] > eN.bi.off); + assert(lv["h5"] > eN.bi.off); + assert(lv["h7"] == eN.bi.off); + } else if (lv["h5"] > eN.bi.off) { + assert(lv["h4"] > eN.bi.off); + assert(lv["h6"] == eN.bi.off); + assert(lv["h7"] == eN.bi.off); + } else if (lv["h4"] > eN.bi.off) { + assert(lv["h5"] == eN.bi.off); + assert(lv["h6"] == eN.bi.off); + assert(lv["h7"] == eN.bi.off); } else { - assert(lv["h4"] == State.off); - assert(lv["h5"] == State.off); - assert(lv["h6"] == State.off); - assert(lv["h7"] == State.off); + assert(lv["h4"] == eN.bi.off); + assert(lv["h5"] == eN.bi.off); + assert(lv["h6"] == eN.bi.off); + assert(lv["h7"] == eN.bi.off); } - if (lv["h0"] == State.off) { - assert(lv["h1"] == State.off); - assert(lv["h2"] == State.off); - assert(lv["h3"] == State.off); - assert(lv["h4"] == State.off); - assert(lv["h5"] == State.off); - assert(lv["h6"] == State.off); - assert(lv["h7"] == State.off); + if (lv["h0"] == eN.bi.off) { + assert(lv["h1"] == eN.bi.off); + assert(lv["h2"] == eN.bi.off); + assert(lv["h3"] == eN.bi.off); + assert(lv["h4"] == eN.bi.off); + assert(lv["h5"] == eN.bi.off); + assert(lv["h6"] == eN.bi.off); + assert(lv["h7"] == eN.bi.off); } - if (lv["h1"] == State.off) { - assert(lv["h2"] == State.off); - assert(lv["h3"] == State.off); + if (lv["h1"] == eN.bi.off) { + assert(lv["h2"] == eN.bi.off); + assert(lv["h3"] == eN.bi.off); } - if (lv["h2"] == State.off) { - assert(lv["h3"] == State.off); + if (lv["h2"] == eN.bi.off) { + assert(lv["h3"] == eN.bi.off); } - if (lv["h3"] == State.off) { + if (lv["h3"] == eN.bi.off) { } - if (lv["h4"] == State.off) { - assert(lv["h5"] == State.off); - assert(lv["h6"] == State.off); - assert(lv["h7"] == State.off); + if (lv["h4"] == eN.bi.off) { + assert(lv["h5"] == eN.bi.off); + assert(lv["h6"] == eN.bi.off); + assert(lv["h7"] == eN.bi.off); } - if (lv["h5"] == State.off) { - assert(lv["h6"] == State.off); - assert(lv["h7"] == State.off); + if (lv["h5"] == eN.bi.off) { + assert(lv["h6"] == eN.bi.off); + assert(lv["h7"] == eN.bi.off); } - if (lv["h6"] == State.off) { - assert(lv["h7"] == State.off); + if (lv["h6"] == eN.bi.off) { + assert(lv["h7"] == eN.bi.off); } - if (lv["h7"] == State.off) { + if (lv["h7"] == eN.bi.off) { } switch ((an_object["lev"]).to!string) { case "A": - if (lv["h0"] == State.off) { - assert(lv["h1"] == State.off); - assert(lv["h2"] == State.off); - assert(lv["h3"] == State.off); - assert(lv["h4"] == State.off); - assert(lv["h5"] == State.off); - assert(lv["h6"] == State.off); - assert(lv["h7"] == State.off); - } else { // (lv["h0"] > State.off) - assert(lv["h0"] == State.off,"error should not enter level A a second time"); + if (lv["h0"] == eN.bi.off) { + assert(lv["h1"] == eN.bi.off); + assert(lv["h2"] == eN.bi.off); + assert(lv["h3"] == eN.bi.off); + assert(lv["h4"] == eN.bi.off); + assert(lv["h5"] == eN.bi.off); + assert(lv["h6"] == eN.bi.off); + assert(lv["h7"] == eN.bi.off); + } else { // (lv["h0"] > eN.bi.off) + assert(lv["h0"] == eN.bi.off,"error should not enter level A a second time"); } break; case "B": - if (lv["h1"] == State.off) { - assert(lv["h0"] > State.off); - assert(lv["h2"] == State.off); - assert(lv["h3"] == State.off); - } else { // (lv["h1"] > State.off) - assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); + if (lv["h1"] == eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h2"] == eN.bi.off); + assert(lv["h3"] == eN.bi.off); + } else { // (lv["h1"] > eN.bi.off) + assert(lv["h0"] > eN.bi.off); + assert(lv["h1"] > eN.bi.off); } break; case "C": - if (lv["h2"] == State.off) { - assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); - assert(lv["h3"] == State.off); - } else { // (lv["h2"] > State.off) - assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); - assert(lv["h2"] > State.off); + if (lv["h2"] == eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h1"] > eN.bi.off); + assert(lv["h3"] == eN.bi.off); + } else { // (lv["h2"] > eN.bi.off) + assert(lv["h0"] > eN.bi.off); + assert(lv["h1"] > eN.bi.off); + assert(lv["h2"] > eN.bi.off); } break; case "D": - if (lv["h3"] == State.off) { - assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); - assert(lv["h2"] > State.off); - } else { // (lv["h3"] > State.off) - assert(lv["h0"] > State.off); - assert(lv["h1"] > State.off); - assert(lv["h2"] > State.off); - assert(lv["h3"] > State.off); + if (lv["h3"] == eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h1"] > eN.bi.off); + assert(lv["h2"] > eN.bi.off); + } else { // (lv["h3"] > eN.bi.off) + assert(lv["h0"] > eN.bi.off); + assert(lv["h1"] > eN.bi.off); + assert(lv["h2"] > eN.bi.off); + assert(lv["h3"] > eN.bi.off); } break; case "1": - if (lv["h4"] == State.off) { - assert(lv["h0"] > State.off); - } else { // (lv["h4"] > State.off) - assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); + if (lv["h4"] == eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + } else { // (lv["h4"] > eN.bi.off) + assert(lv["h0"] > eN.bi.off); + assert(lv["h4"] > eN.bi.off); } break; case "2": - if (lv["h5"] == State.off) { - assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); - } else { // (lv["h5"] > State.off) - assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); + if (lv["h5"] == eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h4"] > eN.bi.off); + } else { // (lv["h5"] > eN.bi.off) + assert(lv["h0"] > eN.bi.off); + assert(lv["h4"] > eN.bi.off); + assert(lv["h5"] > eN.bi.off); } break; case "3": - if (lv["h6"] == State.off) { - assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); - } else { // (lv["h6"] > State.off) - assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); - assert(lv["h6"] > State.off); + if (lv["h6"] == eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h4"] > eN.bi.off); + assert(lv["h5"] > eN.bi.off); + } else { // (lv["h6"] > eN.bi.off) + assert(lv["h0"] > eN.bi.off); + assert(lv["h4"] > eN.bi.off); + assert(lv["h5"] > eN.bi.off); + assert(lv["h6"] > eN.bi.off); } break; case "4": - if (lv["h7"] == State.off) { - assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); - assert(lv["h6"] > State.off); - } else { // (lv["h7"] > State.off) - assert(lv["h0"] > State.off); - assert(lv["h4"] > State.off); - assert(lv["h5"] > State.off); - assert(lv["h6"] > State.off); - assert(lv["h7"] > State.off); + if (lv["h7"] == eN.bi.off) { + assert(lv["h0"] > eN.bi.off); + assert(lv["h4"] > eN.bi.off); + assert(lv["h5"] > eN.bi.off); + assert(lv["h6"] > eN.bi.off); + } else { // (lv["h7"] > eN.bi.off) + assert(lv["h0"] > eN.bi.off); + assert(lv["h4"] > eN.bi.off); + assert(lv["h5"] > eN.bi.off); + assert(lv["h6"] > eN.bi.off); + assert(lv["h7"] > eN.bi.off); } break; default: @@ -7607,24 +7624,24 @@ struct NodeStructureMetadata { #+BEGIN_SRC d @safe pure void assertions_flag_types_block_status_none_or_closed()(int[string] obj_type_status) { assert( - (obj_type_status["code"] == TriState.off) - || (obj_type_status["code"] == TriState.closing), + (obj_type_status["code"] == eN.tri.off) + || (obj_type_status["code"] == eN.tri.closing), "code block status: off or closing"); assert( - (obj_type_status["poem"] == TriState.off) - || (obj_type_status["poem"] == TriState.closing), + (obj_type_status["poem"] == eN.tri.off) + || (obj_type_status["poem"] == eN.tri.closing), "poem status: off or closing"); assert( - (obj_type_status["table"] == TriState.off) - || (obj_type_status["table"] == TriState.closing), + (obj_type_status["table"] == eN.tri.off) + || (obj_type_status["table"] == eN.tri.closing), "table status: off or closing"); assert( - (obj_type_status["group"] == TriState.off) - || (obj_type_status["group"] == TriState.closing), + (obj_type_status["group"] == eN.tri.off) + || (obj_type_status["group"] == eN.tri.closing), "group block status: off or closing"); assert( - (obj_type_status["block"] == TriState.off) - || (obj_type_status["block"] == TriState.closing), + (obj_type_status["block"] == eN.tri.off) + || (obj_type_status["block"] == eN.tri.closing), "block status: off or closing"); } #+END_SRC -- cgit v1.2.3