From 3be1d59280d0614e23f968b928c4d73c4113a466 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 31 Jul 2018 10:37:33 -0400 Subject: 0.26.6 prepare for parallelism, remove __gshared --- org/meta_abstraction.org | 74 +++++++++++++++++++++++++++++------------ org/sdp.org | 3 +- src/sdp/meta/metadoc.d | 1 + src/sdp/meta/metadoc_from_src.d | 74 +++++++++++++++++++++++++++++------------ views/version.txt | 2 +- 5 files changed, 110 insertions(+), 44 deletions(-) diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index 18bf8d6..05f204d 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -41,6 +41,7 @@ template SiSUdocAbstraction() { CMM conf_make_meta, Opt opt_action, Mfst manifest_matter, + bool _new_doc ) { static auto rgx = Rgx(); debug(asserts) { @@ -1156,10 +1157,16 @@ if ((obj_type_status["heading"] == State.on) an_object["is"] = "heading"; an_object_key="body_nugget"; auto substantive_object_and_anchor_tags_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, _new_doc); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[sObj.content]; anchor_tags = substantive_object_and_anchor_tags_tuple[sObj.anchor_tags]; - if (an_object["lev_markup_number"].to!int == 4) { + if (_new_doc) { + cnt1 = 1; + cnt2 = 1; + cnt3 = 1; + _new_doc = false; + } + if (an_object["lev_markup_number"].to!int == 4 ) { segment_anchor_tag_that_object_belongs_to = anchor_tags[0]; segment_anchor_tag_that_object_belongs_to_uri = anchor_tags[0] ~ ".fnSuffix"; anchor_tag_ = anchor_tags[0]; @@ -1264,7 +1271,7 @@ if ((obj_type_status["heading"] == State.on) an_object["is"], ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_para = comp_obj_para.init; @@ -2673,6 +2680,12 @@ if (the_document_body_section.length > 1) { the_bookindex_section["scroll"] ~ the_blurb_section ); + debug(decendants_tuple) { + pairs = pairs.sort(); + foreach (pair; pairs) { // (pair; pairs.sort()) + writeln(pair[0], "..", pair[1]); + } + } foreach (ref obj; the_document_head_section) { if (obj.metainfo.is_a == "heading") { foreach (pair; pairs) { @@ -3749,7 +3762,7 @@ void _poem_block_(L,O,T,C,N,CMM)( } an_object["is"] = "verse"; auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -3806,7 +3819,7 @@ void _poem_block_(L,O,T,C,N,CMM)( an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -3848,7 +3861,7 @@ void _poem_block_(L,O,T,C,N,CMM)( processing.remove("verse"); an_object["is"] = "verse"; auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -3905,7 +3918,7 @@ void _poem_block_(L,O,T,C,N,CMM)( an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -4049,7 +4062,7 @@ void _table_closed_make_special_notation_table_(N,CMM)( ); an_object["is"] = "table"; auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block.metainfo.ocn = obj_cite_digits.on; comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; @@ -4120,7 +4133,7 @@ void _block_flag_line_empty_(B,N,CMM)( an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -4169,7 +4182,7 @@ void _block_flag_line_empty_(B,N,CMM)( an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -4218,7 +4231,7 @@ void _block_flag_line_empty_(B,N,CMM)( an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; comp_obj_block.metainfo.is_of_part = "body"; @@ -4306,7 +4319,7 @@ void _block_flag_line_empty_(B,N,CMM)( an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_code = comp_obj_code.init; @@ -4356,7 +4369,7 @@ void _block_flag_line_empty_(B,N,CMM)( an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; comp_obj_block.metainfo.ocn = obj_cite_digits.on; @@ -5639,6 +5652,8 @@ static struct ObjInlineMarkup { static auto rgx = Rgx(); static auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; + static string[] anchor_tags_ = []; + static string anchor_tag = ""; #+END_SRC ******* object inline markup and anchor tags :markup:inline: @@ -5649,6 +5664,7 @@ static struct ObjInlineMarkup { O obj_, K obj_key_, CMM conf_make_meta, + bool _new_doc ) in { debug(asserts) { @@ -5661,7 +5677,9 @@ static struct ObjInlineMarkup { obj_txt["munge"] = (obj_["is"].match(ctRegex!(`verse|code`))) ? obj_txt["munge"] : obj_txt["munge"].strip; - static __gshared string[] anchor_tags_ = []; + if (_new_doc) { + anchor_tags_ = []; + } auto x = munge.init; bool[string] obj_notes_and_links; obj_notes_and_links["notes_reg"] = false; @@ -5670,9 +5688,11 @@ static struct ObjInlineMarkup { obj_notes_and_links["image_no_dimensions"] = false; switch (obj_["is"]) { case "heading": - static __gshared string anchor_tag = ""; - obj_txt["munge"]=_configured_auto_heading_numbering_and_segment_anchor_tags(obj_txt["munge"], obj_, conf_make_meta); - obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"]); + if (_new_doc) { + anchor_tag = ""; + } + obj_txt["munge"]=_configured_auto_heading_numbering_and_segment_anchor_tags(obj_txt["munge"], obj_, conf_make_meta, _new_doc); + obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"], _new_doc); if (auto m = obj_txt["munge"].match(rgx.heading_anchor_tag)) { anchor_tag = m.captures[1]; anchor_tags_ ~= anchor_tag; @@ -5930,17 +5950,22 @@ private: #+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d + static int[] heading_num = [ 0, 0, 0, 0 ]; + static string heading_number_auto_composite = ""; static string _configured_auto_heading_numbering_and_segment_anchor_tags(M,O,CMM)( M munge_, O obj_, CMM conf_make_meta, + bool _new_doc ) { debug(asserts) { static assert(is(typeof(munge_) == string)); static assert(is(typeof(obj_) == string[string])); } - static __gshared int[] heading_num = [ 0, 0, 0, 0 ]; - static __gshared string heading_number_auto_composite = ""; + if (_new_doc) { + heading_num = [ 0, 0, 0, 0 ]; + heading_number_auto_composite = ""; + } if (conf_make_meta.make.auto_num_top_lv) { if (obj_["lev_markup_number"].to!int == 0) { heading_num[0] = 0; @@ -6040,7 +6065,12 @@ private: #+name: meta_emitters_obj_inline_markup_heading_numbering_segment_anchor_tags #+BEGIN_SRC d - static string _make_segment_anchor_tags_if_none_provided(M,Lv)(M munge_, Lv lev_) { + static int heading_num_lev1 = 0; + static string _make_segment_anchor_tags_if_none_provided(M,Lv)( + M munge_, + Lv lev_, + bool _new_doc + ) { debug(asserts) { static assert(is(typeof(munge_) == string)); static assert(is(typeof(lev_) == string)); @@ -6057,7 +6087,9 @@ private: "$1~" ~ "s" ~ m.captures[1] ~ " "); } } else if (lev_ == "1") { // (if not successful) manufacture a unique anchor tag for lev=="1" - static __gshared int heading_num_lev1 = 0; + if (_new_doc) { + heading_num_lev1 = 0; + } heading_num_lev1 ++; munge_=(munge_).replaceFirst( rgx.heading_marker_missing_tag, diff --git a/org/sdp.org b/org/sdp.org index 8796a6b..83e0b4e 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -26,7 +26,7 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 26, 5); +enum ver = Version(0, 26, 6); #+END_SRC ** compilation restrictions (supported compilers) @@ -856,6 +856,7 @@ auto da = SiSUdocAbstraction!()( _make_and_meta_struct, _opt_action, _manifest, + true, ); static assert(!isTypeTuple!(da)); static assert(da.length==5); diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d index ff550b5..5821096 100644 --- a/src/sdp/meta/metadoc.d +++ b/src/sdp/meta/metadoc.d @@ -77,6 +77,7 @@ template SiSUabstraction() { _make_and_meta_struct, _opt_action, _manifest, + true, ); static assert(!isTypeTuple!(da)); static assert(da.length==5); diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d index 8de0711..7c68e16 100644 --- a/src/sdp/meta/metadoc_from_src.d +++ b/src/sdp/meta/metadoc_from_src.d @@ -241,6 +241,7 @@ template SiSUdocAbstraction() { CMM conf_make_meta, Opt opt_action, Mfst manifest_matter, + bool _new_doc ) { static auto rgx = Rgx(); debug(asserts) { @@ -833,10 +834,16 @@ template SiSUdocAbstraction() { an_object["is"] = "heading"; an_object_key="body_nugget"; auto substantive_object_and_anchor_tags_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, _new_doc); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[sObj.content]; anchor_tags = substantive_object_and_anchor_tags_tuple[sObj.anchor_tags]; - if (an_object["lev_markup_number"].to!int == 4) { + if (_new_doc) { + cnt1 = 1; + cnt2 = 1; + cnt3 = 1; + _new_doc = false; + } + if (an_object["lev_markup_number"].to!int == 4 ) { segment_anchor_tag_that_object_belongs_to = anchor_tags[0]; segment_anchor_tag_that_object_belongs_to_uri = anchor_tags[0] ~ ".fnSuffix"; anchor_tag_ = anchor_tags[0]; @@ -935,7 +942,7 @@ template SiSUdocAbstraction() { an_object["is"], ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_para = comp_obj_para.init; @@ -2056,6 +2063,12 @@ template SiSUdocAbstraction() { the_bookindex_section["scroll"] ~ the_blurb_section ); + debug(decendants_tuple) { + pairs = pairs.sort(); + foreach (pair; pairs) { // (pair; pairs.sort()) + writeln(pair[0], "..", pair[1]); + } + } foreach (ref obj; the_document_head_section) { if (obj.metainfo.is_a == "heading") { foreach (pair; pairs) { @@ -2754,7 +2767,7 @@ template SiSUdocAbstraction() { } an_object["is"] = "verse"; auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -2811,7 +2824,7 @@ template SiSUdocAbstraction() { an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -2853,7 +2866,7 @@ template SiSUdocAbstraction() { processing.remove("verse"); an_object["is"] = "verse"; auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -2910,7 +2923,7 @@ template SiSUdocAbstraction() { an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -3211,7 +3224,7 @@ template SiSUdocAbstraction() { ); an_object["is"] = "table"; auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block.metainfo.ocn = obj_cite_digits.on; comp_obj_block.metainfo.object_number_off = (obj_cite_digits.off==0) ? "" : obj_cite_digits.off.to!string; @@ -3268,7 +3281,7 @@ template SiSUdocAbstraction() { an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -3311,7 +3324,7 @@ template SiSUdocAbstraction() { an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_block = comp_obj_block.init; @@ -3354,7 +3367,7 @@ template SiSUdocAbstraction() { an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; comp_obj_block.metainfo.is_of_part = "body"; @@ -3430,7 +3443,7 @@ template SiSUdocAbstraction() { an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags]; comp_obj_code = comp_obj_code.init; @@ -3474,7 +3487,7 @@ template SiSUdocAbstraction() { an_object["is"] ); auto substantive_obj_misc_tuple - = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta); + = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta, false); an_object["substantive"] = substantive_obj_misc_tuple[sObj.content]; comp_obj_block = comp_obj_block.init; comp_obj_block.metainfo.ocn = obj_cite_digits.on; @@ -4536,10 +4549,13 @@ template SiSUdocAbstraction() { static auto rgx = Rgx(); static auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; + static string[] anchor_tags_ = []; + static string anchor_tag = ""; auto obj_inline_markup_and_anchor_tags_and_misc(O,K,CMM)( O obj_, K obj_key_, CMM conf_make_meta, + bool _new_doc ) in { debug(asserts) { @@ -4552,7 +4568,9 @@ template SiSUdocAbstraction() { obj_txt["munge"] = (obj_["is"].match(ctRegex!(`verse|code`))) ? obj_txt["munge"] : obj_txt["munge"].strip; - static __gshared string[] anchor_tags_ = []; + if (_new_doc) { + anchor_tags_ = []; + } auto x = munge.init; bool[string] obj_notes_and_links; obj_notes_and_links["notes_reg"] = false; @@ -4561,9 +4579,11 @@ template SiSUdocAbstraction() { obj_notes_and_links["image_no_dimensions"] = false; switch (obj_["is"]) { case "heading": - static __gshared string anchor_tag = ""; - obj_txt["munge"]=_configured_auto_heading_numbering_and_segment_anchor_tags(obj_txt["munge"], obj_, conf_make_meta); - obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"]); + if (_new_doc) { + anchor_tag = ""; + } + obj_txt["munge"]=_configured_auto_heading_numbering_and_segment_anchor_tags(obj_txt["munge"], obj_, conf_make_meta, _new_doc); + obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"], _new_doc); if (auto m = obj_txt["munge"].match(rgx.heading_anchor_tag)) { anchor_tag = m.captures[1]; anchor_tags_ ~= anchor_tag; @@ -4803,17 +4823,22 @@ template SiSUdocAbstraction() { invariant() { } private: + static int[] heading_num = [ 0, 0, 0, 0 ]; + static string heading_number_auto_composite = ""; static string _configured_auto_heading_numbering_and_segment_anchor_tags(M,O,CMM)( M munge_, O obj_, CMM conf_make_meta, + bool _new_doc ) { debug(asserts) { static assert(is(typeof(munge_) == string)); static assert(is(typeof(obj_) == string[string])); } - static __gshared int[] heading_num = [ 0, 0, 0, 0 ]; - static __gshared string heading_number_auto_composite = ""; + if (_new_doc) { + heading_num = [ 0, 0, 0, 0 ]; + heading_number_auto_composite = ""; + } if (conf_make_meta.make.auto_num_top_lv) { if (obj_["lev_markup_number"].to!int == 0) { heading_num[0] = 0; @@ -4907,7 +4932,12 @@ template SiSUdocAbstraction() { } return munge_; } - static string _make_segment_anchor_tags_if_none_provided(M,Lv)(M munge_, Lv lev_) { + static int heading_num_lev1 = 0; + static string _make_segment_anchor_tags_if_none_provided(M,Lv)( + M munge_, + Lv lev_, + bool _new_doc + ) { debug(asserts) { static assert(is(typeof(munge_) == string)); static assert(is(typeof(lev_) == string)); @@ -4924,7 +4954,9 @@ template SiSUdocAbstraction() { "$1~" ~ "s" ~ m.captures[1] ~ " "); } } else if (lev_ == "1") { // (if not successful) manufacture a unique anchor tag for lev=="1" - static __gshared int heading_num_lev1 = 0; + if (_new_doc) { + heading_num_lev1 = 0; + } heading_num_lev1 ++; munge_=(munge_).replaceFirst( rgx.heading_marker_missing_tag, diff --git a/views/version.txt b/views/version.txt index d4c7c09..f9a8560 100644 --- a/views/version.txt +++ b/views/version.txt @@ -4,7 +4,7 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 26, 5); +enum ver = Version(0, 26, 6); version (Posix) { version (DigitalMars) { } else version (LDC) { -- cgit v1.2.3