From 5a4df097b2976c24c449c56cf035995edfb1261e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 7 Mar 2017 09:11:09 -0500 Subject: 0.13.6 dlang function calls, syntax (ufcs related), logic should be retained --- src/sdp/ao_abstract_doc_source.d | 576 +++++++++++++++++++-------------------- 1 file changed, 284 insertions(+), 292 deletions(-) (limited to 'src/sdp/ao_abstract_doc_source.d') diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 82341cd..a277a61 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -92,47 +92,47 @@ template SiSUdocAbstraction() { ) { switch (obj.heading_lev_markup) { case 0: - lv_ancestors[0] = to!string(obj.text); + lv_ancestors[0] = obj.text.to!string; foreach(k; 1..8) { lv_ancestors[k] = ""; } goto default; case 1: - lv_ancestors[1] = to!string(obj.text); + lv_ancestors[1] = obj.text.to!string; foreach(k; 2..8) { lv_ancestors[k] = ""; } goto default; case 2: - lv_ancestors[2] = to!string(obj.text); + lv_ancestors[2] = obj.text.to!string; foreach(k; 3..8) { lv_ancestors[k] = ""; } goto default; case 3: - lv_ancestors[3] = to!string(obj.text); + lv_ancestors[3] = obj.text.to!string; foreach(k; 4..8) { lv_ancestors[k] = ""; } goto default; case 4: - lv_ancestors[4] = to!string(obj.text); + lv_ancestors[4] = obj.text.to!string; foreach(k; 5..8) { lv_ancestors[k] = ""; } goto default; case 5: - lv_ancestors[5] = to!string(obj.text); + lv_ancestors[5] = obj.text.to!string; foreach(k; 6..8) { lv_ancestors[k] = ""; } goto default; case 6: - lv_ancestors[6] = to!string(obj.text); + lv_ancestors[6] = obj.text.to!string; lv_ancestors[7] = ""; goto default; case 7: - lv_ancestors[7] = to!string(obj.text); + lv_ancestors[7] = obj.text.to!string; goto default; default: obj.heading_ancestors_text = lv_ancestors.dup; @@ -387,11 +387,11 @@ template SiSUdocAbstraction() { /+ object other than "code block" object (includes regular text paragraph, headings & blocks other than code) +/ /+ heading, glossary, blurb, poem, group, block, quote, table +/ - if ((matchFirst(line, rgx.heading_biblio) + if (line.matchFirst(rgx.heading_biblio) || (type["biblio_section"] == State.on - && (!matchFirst(line, rgx.heading_blurb_glossary)))) - && (!matchFirst(line, rgx.heading)) - && (!matchFirst(line, rgx.comment))) { + && (!(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; @@ -404,11 +404,11 @@ template SiSUdocAbstraction() { } } continue; - } else if ((matchFirst(line, rgx.heading_glossary) + } else if (line.matchFirst(rgx.heading_glossary) || (type["glossary_section"] == State.on - && (!matchFirst(line, rgx.heading_biblio_blurb)))) - && (!matchFirst(line, rgx.heading)) - && (!matchFirst(line, rgx.comment))) { + && (!(line.matchFirst(rgx.heading_biblio_blurb))) + && (!(line.matchFirst(rgx.heading))) + && (!(line.matchFirst(rgx.comment))))) { /+ within section (block object): glossary +/ debug(glossary) { writeln(__LINE__); @@ -427,7 +427,7 @@ template SiSUdocAbstraction() { type["para"] = State.on; line_occur["para"] = State.off; an_object_key="glossary_nugget"; // - if (matchFirst(line, rgx.heading_glossary)) { + if (line.matchFirst(rgx.heading_glossary)) { comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; comp_obj_heading_.is_of = "para"; @@ -462,7 +462,7 @@ template SiSUdocAbstraction() { comp_obj_para.use = "backmatter"; comp_obj_para.is_of = "para"; comp_obj_para.is_a = "glossary"; - comp_obj_para.text = to!string(line).strip; + comp_obj_para.text = line.to!string.strip; comp_obj_para.ocn = 0; comp_obj_para.obj_cite_number = ""; comp_obj_para.indent_hang = indent["hang_position"]; @@ -473,11 +473,11 @@ template SiSUdocAbstraction() { type["ocn_status"] = TriState.off; } continue; - } else if ((matchFirst(line, rgx.heading_blurb) + } else if (line.matchFirst(rgx.heading_blurb) || (type["blurb_section"] == State.on - && (!matchFirst(line, rgx.heading_biblio_glossary)))) - && (!matchFirst(line, rgx.heading)) - && (!matchFirst(line, rgx.comment))) { + && (!(line.matchFirst(rgx.heading_biblio_glossary))) + && (!(line.matchFirst(rgx.heading))) + && (!(line.matchFirst(rgx.comment))))) { /+ within section (block object): blurb +/ debug(blurb) { writeln(__LINE__); @@ -495,7 +495,7 @@ template SiSUdocAbstraction() { type["para"] = State.on; line_occur["para"] = State.off; an_object_key="blurb_nugget"; - if (matchFirst(line, rgx.heading_blurb)) { + if (line.matchFirst(rgx.heading_blurb)) { comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; comp_obj_heading_.is_of = "para"; @@ -524,19 +524,19 @@ template SiSUdocAbstraction() { comp_obj_heading_.parent_lev_markup = 0; comp_obj_heading_.anchor_tags = ["blurb"]; the_blurb_section ~= comp_obj_heading_; - } else if ((matchFirst(line, rgx.heading)) + } else if (line.matchFirst(rgx.heading) && (opt_action_bool["backmatter"] && opt_action_bool["section_blurb"])) { comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; comp_obj_heading_.is_of = "para"; comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.text = to!string(line); + comp_obj_heading_.text = line.to!string; comp_obj_heading_.ocn = 0; comp_obj_heading_.obj_cite_number = ""; comp_obj_heading_.segment_anchor_tag = "blurb"; - comp_obj_heading_.marked_up_level = to!string(an_object["lev"]); - comp_obj_heading_.heading_lev_markup = to!int(an_object["lev_markup_number"]); // make int, remove need to conv - comp_obj_heading_.heading_lev_collapsed = to!int(an_object["lev_collapsed_number"]); // make int, remove need to conv + comp_obj_heading_.marked_up_level = an_object["lev"].to!string; + comp_obj_heading_.heading_lev_markup = an_object["lev_markup_number"].to!int; // make int, remove need to conv + comp_obj_heading_.heading_lev_collapsed = an_object["lev_collapsed_number"].to!int; // make int, remove need to conv comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; the_blurb_section ~= comp_obj_heading_; @@ -546,7 +546,7 @@ template SiSUdocAbstraction() { comp_obj_para.use = "backmatter"; comp_obj_para.is_of = "para"; comp_obj_para.is_a = "blurb"; - comp_obj_para.text = to!string(line).strip; + comp_obj_para.text = line.to!string.strip; comp_obj_para.ocn = 0; comp_obj_para.obj_cite_number = ""; comp_obj_para.indent_hang = indent["hang_position"]; @@ -586,12 +586,12 @@ template SiSUdocAbstraction() { "block status: none or closed" ); assertions_flag_types_block_status_none_or_closed(type); - if (matchFirst(line, rgx.block_open)) { - if (matchFirst(line, (rgx.block_poem_open))) { + if (line.matchFirst(rgx.block_open)) { + if (line.matchFirst(rgx.block_poem_open)) { /+ poem to verse exceptions! +/ object_reset(an_object); processing.remove("verse"); - obj_cite_number_poem["start"] = to!string(obj_cite_number); + obj_cite_number_poem["start"] = obj_cite_number.to!string; } _start_block_(line, type, obj_cite_number_poem); continue; @@ -614,14 +614,14 @@ template SiSUdocAbstraction() { writeln(line); } assert( - matchFirst(line, rgx.book_index) - || matchFirst(line, rgx.book_index_open) + line.matchFirst(rgx.book_index) + || line.matchFirst(rgx.book_index_open) || type["book_index"] == State.on ); } - if ((matchFirst(line, rgx.book_index)) - || (matchFirst(line, rgx.book_index_open)) - || (type["book_index"] == State.on )) { + if (line.matchFirst(rgx.book_index) + || line.matchFirst(rgx.book_index_open) + || type["book_index"] == State.on ) { /+ book_index +/ _book_index_(line, book_idx_tmp, an_object, type, opt_action_bool); } else { @@ -667,7 +667,7 @@ template SiSUdocAbstraction() { - should happen before endnote links set (they need to be moved down?) // node_construct.node_emitter_heading segment anchor tag +/ - if (matchFirst(line, rgx.heading)) { + if (line.matchFirst(rgx.heading)) { /+ heading match +/ _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa); } else if (line_occur["para"] == State.off) { @@ -719,7 +719,7 @@ template SiSUdocAbstraction() { if ((type["heading"] == State.on) && (line_occur["heading"] > State.off)) { /+ heading object (current line empty) +/ - obj_cite_number = (to!int(an_object["lev_markup_number"]) == 0) + obj_cite_number = (an_object["lev_markup_number"].to!int == 0) ? (ocn_emit(3)) : (obj_cite_number = ocn_emit(type["ocn_status"])); an_object["is"] = "heading"; @@ -728,14 +728,14 @@ template SiSUdocAbstraction() { obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa); an_object["substantive"] = substantive_object_and_anchor_tags_tuple[sObj.content]; anchor_tags = substantive_object_and_anchor_tags_tuple[sObj.anchor_tags]; - if (to!int(an_object["lev_markup_number"]) == 4) { + 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]; - } else if (to!int(an_object["lev_markup_number"]) > 4) { + } else if (an_object["lev_markup_number"].to!int > 4) { segment_anchor_tag_that_object_belongs_to = anchor_tag_; - segment_anchor_tag_that_object_belongs_to_uri = anchor_tag_ ~ ".fnSuffix#" ~ to!string(obj_cite_number); - } else if (to!int(an_object["lev_markup_number"]) < 4) { + segment_anchor_tag_that_object_belongs_to_uri = anchor_tag_ ~ ".fnSuffix#" ~ obj_cite_number.to!string; + } else if (an_object["lev_markup_number"].to!int < 4) { segment_anchor_tag_that_object_belongs_to = ""; segment_anchor_tag_that_object_belongs_to_uri = ""; } @@ -816,9 +816,9 @@ template SiSUdocAbstraction() { comp_obj_para.use = "body"; comp_obj_para.is_of = "para"; comp_obj_para.is_a = "para"; - comp_obj_para.text = to!string(an_object["substantive"]).strip; + comp_obj_para.text = an_object["substantive"].to!string.strip; comp_obj_para.ocn = obj_cite_number; - comp_obj_para.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_para.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_para.indent_hang = indent["hang_position"]; comp_obj_para.indent_base = indent["base_position"]; comp_obj_para.bullet = bullet; @@ -857,12 +857,11 @@ template SiSUdocAbstraction() { type["glossary_section"] = State.off; type["blurb_section"] = State.off; } - previous_length = to!int(the_document_body_section.length); - if (match( - the_document_body_section[$-1].text, + previous_length = the_document_body_section.length.to!int; + if ((the_document_body_section[$-1].text).match( rgx.inline_notes_delimiter_al_regular_number_note )) { - previous_count=to!int(the_document_body_section.length -1); + previous_count=(the_document_body_section.length -1).to!int; note_section.gather_notes_for_endnote_section( the_document_body_section, segment_anchor_tag_that_object_belongs_to, @@ -979,7 +978,7 @@ template SiSUdocAbstraction() { comp_obj_para.use = "backmatter"; comp_obj_para.is_of = "para"; comp_obj_para.is_a = "bibliography"; - comp_obj_para.text = to!string(out_).strip; + comp_obj_para.text = out_.to!string.strip; comp_obj_para.ocn = 0; comp_obj_para.obj_cite_number = ""; comp_obj_para.indent_hang = 0; @@ -1052,7 +1051,7 @@ template SiSUdocAbstraction() { ".fnSuffix", ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; } @@ -1065,7 +1064,7 @@ template SiSUdocAbstraction() { ".fnSuffix", ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; toc_txt_ = format( @@ -1074,7 +1073,7 @@ template SiSUdocAbstraction() { "glossary", // _anchor_tag ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } @@ -1087,7 +1086,7 @@ template SiSUdocAbstraction() { ".fnSuffix", ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; @@ -1097,7 +1096,7 @@ template SiSUdocAbstraction() { "bibliography", // _anchor_tag ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } @@ -1110,7 +1109,7 @@ template SiSUdocAbstraction() { ".fnSuffix", ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; } @@ -1121,7 +1120,7 @@ template SiSUdocAbstraction() { "bookindex", // _anchor_tag ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } @@ -1134,7 +1133,7 @@ template SiSUdocAbstraction() { ".fnSuffix", ); toc_txt_= munge.url_links(toc_txt_); - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; toc_txt_ = format( @@ -1144,7 +1143,7 @@ template SiSUdocAbstraction() { ); toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.inline_links = true; - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } debug(toc) { @@ -1233,7 +1232,7 @@ template SiSUdocAbstraction() { string[] _images; auto extract_images(S)(S content_block) { string[] images_; - if (auto m = matchAll(content_block, rgx.image)) { + if (auto m = content_block.matchAll(rgx.image)) { images_ ~= m.captures[1]; } return images_; @@ -1640,15 +1639,15 @@ template SiSUdocAbstraction() { auto rgx = Rgx(); if ((!line.empty) && (type["ocn_status_multi_obj"] == TriState.off)) { /+ not multi-line object, check whether obj_cite_number is on or turned off +/ - if (matchFirst(line, rgx.obj_cite_number_block_marks)) { + if (line.matchFirst(rgx.obj_cite_number_block_marks)) { /+ switch off obj_cite_number +/ - if (matchFirst(line, rgx.obj_cite_number_off_block)) { + if (line.matchFirst(rgx.obj_cite_number_off_block)) { type["ocn_status_multi_obj"] = TriState.on; debug(ocnoff) { writeln(line); } } - if (matchFirst(line, rgx.obj_cite_number_off_block_dh)) { + if (line.matchFirst(rgx.obj_cite_number_off_block_dh)) { type["ocn_status_multi_obj"] = TriState.closing; debug(ocnoff) { writeln(line); @@ -1656,9 +1655,9 @@ template SiSUdocAbstraction() { } } else { if (type["ocn_status_multi_obj"] == TriState.off) { - if (matchFirst(line, rgx.obj_cite_number_off)) { + if (line.matchFirst(rgx.obj_cite_number_off)) { type["ocn_status"] = TriState.on; - } else if (matchFirst(line, rgx.obj_cite_number_off_dh)) { + } else if (line.matchFirst(rgx.obj_cite_number_off_dh)) { type["ocn_status"] = TriState.closing; } else { type["ocn_status"] = TriState.off; @@ -1669,7 +1668,7 @@ template SiSUdocAbstraction() { } } } else if ((!line.empty) && (type["ocn_status_multi_obj"] > TriState.off)) { - if (matchFirst(line, rgx.obj_cite_number_off_block_close)) { + if (line.matchFirst(rgx.obj_cite_number_off_block_close)) { type["ocn_status_multi_obj"] = TriState.off; type["ocn_status"] = TriState.off; debug(ocnoff) { @@ -1689,7 +1688,7 @@ template SiSUdocAbstraction() { static assert(is(typeof(obj_cite_number_poem) == string[string])); } auto rgx = Rgx(); - if (matchFirst(line, rgx.block_curly_code_open)) { + if (line.matchFirst(rgx.block_curly_code_open)) { /+ curly code open +/ debug(code) { // code (curly) open writefln( @@ -1700,7 +1699,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["code"] = TriState.on; type["curly_code"] = TriState.on; - } else if (matchFirst(line, rgx.block_curly_poem_open)) { + } else if (line.matchFirst(rgx.block_curly_poem_open)) { /+ curly poem open +/ debug(poem) { // poem (curly) open writefln( @@ -1709,12 +1708,12 @@ template SiSUdocAbstraction() { ); } obj_cite_number_poem["start"] = - to!string(obj_cite_number); + obj_cite_number.to!string; type["blocks"] = TriState.on; type["verse_new"] = State.on; type["poem"] = TriState.on; type["curly_poem"] = TriState.on; - } else if (matchFirst(line, rgx.block_curly_group_open)) { + } else if (line.matchFirst(rgx.block_curly_group_open)) { /+ curly group open +/ debug(group) { // group (curly) open writefln( @@ -1725,7 +1724,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["group"] = TriState.on; type["curly_group"] = TriState.on; - } else if (matchFirst(line, rgx.block_curly_block_open)) { + } else if (line.matchFirst(rgx.block_curly_block_open)) { /+ curly block open +/ debug(block) { // block (curly) open writefln( @@ -1736,7 +1735,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["block"] = TriState.on; type["curly_block"] = TriState.on; - } else if (matchFirst(line, rgx.block_curly_quote_open)) { + } else if (line.matchFirst(rgx.block_curly_quote_open)) { /+ curly quote open +/ debug(quote) { // quote (curly) open writefln( @@ -1747,7 +1746,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["quote"] = TriState.on; type["curly_quote"] = TriState.on; - } else if (matchFirst(line, rgx.block_curly_table_open)) { + } else if (line.matchFirst(rgx.block_curly_table_open)) { /+ curly table open +/ debug(table) { // table (curly) open writefln( @@ -1758,7 +1757,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["table"] = TriState.on; type["curly_table"] = TriState.on; - } else if (matchFirst(line, rgx.block_tic_code_open)) { + } else if (line.matchFirst(rgx.block_tic_code_open)) { /+ tic code open +/ debug(code) { // code (tic) open writefln( @@ -1769,7 +1768,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["code"] = TriState.on; type["tic_code"] = TriState.on; - } else if (matchFirst(line, rgx.block_tic_poem_open)) { + } else if (line.matchFirst(rgx.block_tic_poem_open)) { /+ tic poem open +/ debug(poem) { // poem (tic) open writefln( @@ -1777,12 +1776,12 @@ template SiSUdocAbstraction() { line ); } - obj_cite_number_poem["start"] = to!string(obj_cite_number); + 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; - } else if (matchFirst(line, rgx.block_tic_group_open)) { + } else if (line.matchFirst(rgx.block_tic_group_open)) { /+ tic group open +/ debug(group) { // group (tic) open writefln( @@ -1793,7 +1792,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["group"] = TriState.on; type["tic_group"] = TriState.on; - } else if (matchFirst(line, rgx.block_tic_block_open)) { + } else if (line.matchFirst(rgx.block_tic_block_open)) { /+ tic block open +/ debug(block) { // block (tic) open writefln( @@ -1804,7 +1803,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["block"] = TriState.on; type["tic_block"] = TriState.on; - } else if (matchFirst(line, rgx.block_tic_quote_open)) { + } else if (line.matchFirst(rgx.block_tic_quote_open)) { /+ tic quote open +/ debug(quote) { // quote (tic) open writefln( @@ -1815,7 +1814,7 @@ template SiSUdocAbstraction() { type["blocks"] = TriState.on; type["quote"] = TriState.on; type["tic_quote"] = TriState.on; - } else if (matchFirst(line, rgx.block_tic_table_open)) { + } else if (line.matchFirst(rgx.block_tic_table_open)) { /+ tic table open +/ debug(table) { // table (tic) open writefln( @@ -1840,7 +1839,7 @@ template SiSUdocAbstraction() { } auto rgx = Rgx(); if (type["curly_code"] == TriState.on) { - if (matchFirst(line, rgx.block_curly_code_close)) { + if (line.matchFirst(rgx.block_curly_code_close)) { debug(code) { // code (curly) close writeln(line); } @@ -1854,7 +1853,7 @@ template SiSUdocAbstraction() { an_object[an_object_key] ~= line ~= "\n"; // code (curly) line } } else if (type["tic_code"] == TriState.on) { - if (matchFirst(line, rgx.block_tic_close)) { + if (line.matchFirst(rgx.block_tic_close)) { debug(code) { // code (tic) close writeln(line); } @@ -1901,7 +1900,7 @@ template SiSUdocAbstraction() { mixin SiSUbiblio; auto jsn = BibJsnStr(); auto rgx = Rgx(); - if (matchFirst(line, rgx.heading_biblio)) { + if (line.matchFirst(rgx.heading_biblio)) { type["biblio_section"] = TriState.on; type["blurb_section"] = State.off; type["glossary_section"] = State.off; @@ -1936,16 +1935,16 @@ template SiSUdocAbstraction() { writeln("?? 2. ERROR ", biblio_entry_str_json, "??"); biblio_entry_str_json = ""; } - } else if (matchFirst(line, rgx.biblio_tags)) { + } else if (line.matchFirst(rgx.biblio_tags)) { debug(biblioblock) { writeln(line); } - auto bt = match(line, rgx.biblio_tags); + auto bt = line.match(rgx.biblio_tags); bib_entry = State.off; - st=to!string(bt.captures[1]); - auto header_tag_value=to!string(bt.captures[2]); + st = bt.captures[1].to!string; + auto header_tag_value=(bt.captures[2]).to!string; JSONValue j = parseJSON(biblio_entry_str_json); - biblio_tag_name = (match(st, rgx.biblio_abbreviations)) + biblio_tag_name = (st.match(rgx.biblio_abbreviations)) ? (biblio_tag_map(st)) : st; j.object[biblio_tag_name] = header_tag_value; @@ -1956,11 +1955,11 @@ template SiSUdocAbstraction() { switch (biblio_tag_name) { case "author_raw": // author_arr author (fn sn) j["author_arr"] = - split(header_tag_value, rgx.arr_delimiter); + header_tag_value.split(rgx.arr_delimiter); string tmp; biblioAuthorLoop: foreach (au; j["author_arr"].array) { - if (auto x = match(au.str, rgx.name_delimiter)) { + if (auto x = au.str.match(rgx.name_delimiter)) { tmp ~= x.captures[2] ~ " " ~ x.captures[1] ~ ", "; } else { tmp ~= au.str; @@ -1971,11 +1970,11 @@ template SiSUdocAbstraction() { goto default; case "editor_raw": // editor_arr editor (fn sn) j["editor_arr"] = - split(header_tag_value, rgx.arr_delimiter); + header_tag_value.split(rgx.arr_delimiter); string tmp; biblioEditorLoop: foreach (ed; j["editor_arr"].array) { - if (auto x = match(ed.str, rgx.name_delimiter)) { + if (auto x = ed.str.match(rgx.name_delimiter)) { tmp ~= x.captures[2] ~ " " ~ x.captures[1] ~ ", "; } else { tmp ~= ed.str; @@ -1998,7 +1997,7 @@ template SiSUdocAbstraction() { j[biblio_tag_name] ); } - if ((match(line, rgx.comment))) { + if (line.match(rgx.comment)) { writeln("ERROR", line, "COMMENT"); writeln("ERROR", s, "%%"); } @@ -2026,7 +2025,7 @@ template SiSUdocAbstraction() { } auto rgx = Rgx(); if (type["curly_group"] == State.on) { - if (matchFirst(line, rgx.block_curly_group_close)) { + if (line.matchFirst(rgx.block_curly_group_close)) { debug(group) { writeln(line); } @@ -2040,7 +2039,7 @@ template SiSUdocAbstraction() { an_object[an_object_key] ~= line ~= "\n"; // build group array (or string) } } else if (type["tic_group"] == TriState.on) { - if (matchFirst(line, rgx.block_tic_close)) { + if (line.matchFirst(rgx.block_tic_close)) { debug(group) { writeln(line); } @@ -2067,7 +2066,7 @@ template SiSUdocAbstraction() { } auto rgx = Rgx(); if (type["curly_block"] == TriState.on) { - if (matchFirst(line, rgx.block_curly_block_close)) { + if (line.matchFirst(rgx.block_curly_block_close)) { debug(block) { // block (curly) close writeln(line); } @@ -2081,7 +2080,7 @@ template SiSUdocAbstraction() { an_object[an_object_key] ~= line ~= "\n"; // build block array (or string) } } else if (type["tic_block"] == TriState.on) { - if (matchFirst(line, rgx.block_tic_close)) { + if (line.matchFirst(rgx.block_tic_close)) { debug(block) { writeln(line); } @@ -2114,7 +2113,7 @@ template SiSUdocAbstraction() { } auto rgx = Rgx(); if (type["curly_poem"] == TriState.on) { - if (matchFirst(line, rgx.block_curly_poem_close)) { + if (line.matchFirst(rgx.block_curly_poem_close)) { an_object[an_object_key]="verse"; debug(poem) { // poem (curly) close writefln( @@ -2150,7 +2149,7 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "verse"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2161,7 +2160,7 @@ template SiSUdocAbstraction() { ++cntr; } obj_cite_number_poem["end"] = - to!string(obj_cite_number); + obj_cite_number.to!string; type["blocks"] = TriState.closing; type["poem"] = TriState.closing; type["curly_poem"] = TriState.off; @@ -2171,7 +2170,7 @@ template SiSUdocAbstraction() { obj_cite_number = ocn_emit(type["ocn_status"]); type["verse_new"] = State.off; - } else if (matchFirst(line, rgx.newline_eol_delimiter_only)) { + } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) { verse_line = TriState.off; type["verse_new"] = State.on; } @@ -2204,7 +2203,7 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "verse"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2216,7 +2215,7 @@ template SiSUdocAbstraction() { } } } else if (type["tic_poem"] == TriState.on) { - if (auto m = matchFirst(line, rgx.block_tic_close)) { // tic_poem_close + if (auto m = line.matchFirst(rgx.block_tic_close)) { // tic_poem_close an_object[an_object_key]="verse"; debug(poem) { // poem (curly) close writefln( @@ -2243,13 +2242,13 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "verse"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; 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; - obj_cite_number_poem["end"] = to!string(obj_cite_number); + obj_cite_number_poem["end"] = obj_cite_number.to!string; object_reset(an_object); processing.remove("verse"); ++cntr; @@ -2263,7 +2262,7 @@ template SiSUdocAbstraction() { obj_cite_number = ocn_emit(type["ocn_status"]); type["verse_new"] = State.off; - } else if (matchFirst(line, rgx.newline_eol_delimiter_only)) { + } else if (line.matchFirst(rgx.newline_eol_delimiter_only)) { type["verse_new"] = State.on; verse_line = TriState.off; } @@ -2297,7 +2296,7 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "verse"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2322,7 +2321,7 @@ template SiSUdocAbstraction() { } auto rgx = Rgx(); if (type["curly_quote"] == TriState.on) { - if (matchFirst(line, rgx.block_curly_quote_close)) { + if (line.matchFirst(rgx.block_curly_quote_close)) { debug(quote) { // quote (curly) close writeln(line); } @@ -2336,7 +2335,7 @@ template SiSUdocAbstraction() { an_object[an_object_key] ~= line ~= "\n"; // build quote array (or string) } } else if (type["tic_quote"] == TriState.on) { - if (matchFirst(line, rgx.block_tic_close)) { + if (line.matchFirst(rgx.block_tic_close)) { debug(quote) { // quote (tic) close writeln(line); } @@ -2363,7 +2362,7 @@ template SiSUdocAbstraction() { } auto rgx = Rgx(); if (type["curly_table"] == TriState.on) { - if (matchFirst(line, rgx.block_curly_table_close)) { + if (line.matchFirst(rgx.block_curly_table_close)) { debug(table) { // table (curly) close writeln(line); } @@ -2377,7 +2376,7 @@ template SiSUdocAbstraction() { an_object[an_object_key] ~= line ~= "\n"; // build table array (or string) } } else if (type["tic_table"] == TriState.on) { - if (matchFirst(line, rgx.block_tic_close)) { + if (line.matchFirst(rgx.block_tic_close)) { debug(table) { // table (tic) close writeln(line); } @@ -2445,7 +2444,7 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "group"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2485,7 +2484,7 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "block"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2526,7 +2525,7 @@ template SiSUdocAbstraction() { comp_obj_code.is_of = "block"; comp_obj_code.is_a = "code"; comp_obj_code.ocn = obj_cite_number; - comp_obj_code.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_code.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_code.text = an_object["substantive"]; comp_obj_code.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_code.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2598,7 +2597,7 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "quote"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2639,7 +2638,7 @@ template SiSUdocAbstraction() { comp_obj_block.is_of = "block"; comp_obj_block.is_a = "table"; comp_obj_block.ocn = obj_cite_number; - comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); + comp_obj_block.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; comp_obj_block.text = an_object["substantive"]; comp_obj_block.inline_notes_reg = substantive_obj_misc_tuple[sObj.notes_reg]; comp_obj_block.inline_notes_star = substantive_obj_misc_tuple[sObj.notes_star]; @@ -2667,20 +2666,20 @@ template SiSUdocAbstraction() { static assert(is(typeof(opt_action_bool) == bool[string])); } auto rgx = Rgx(); - if (auto m = match(line, rgx.book_index)) { + if (auto m = line.match(rgx.book_index)) { /+ match book_index +/ debug(bookindexmatch) { // book index writefln( "* [bookindex] %s\n", - to!string(m.captures[1]), + m.captures[1].to!string, ); } - an_object["bookindex_nugget"] = to!string(m.captures[1]); - } else if (auto m = match(line, rgx.book_index_open)) { + 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; if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) { - book_idx_tmp = to!string(m.captures[1]); + book_idx_tmp = m.captures[1].to!string; debug(bookindexmatch) { // book index writefln( "* [bookindex] %s\n", @@ -2690,11 +2689,11 @@ template SiSUdocAbstraction() { } } else if (type["book_index"] == State.on ) { /+ book_index flag set +/ - if (auto m = match(line, rgx.book_index_close)) { + if (auto m = line.match(rgx.book_index_close)) { type["book_index"] = State.off; if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) { - an_object["bookindex_nugget"] = book_idx_tmp ~ to!string(m.captures[1]); + an_object["bookindex_nugget"] = book_idx_tmp ~ m.captures[1].to!string; debug(bookindexmatch) { // book index writefln( "* [bookindex] %s\n", @@ -2733,9 +2732,8 @@ template SiSUdocAbstraction() { writeln(dochead_make_identify_unmarked_headings); } char[][] make_headings_spl = - split( - cast(char[]) dochead_make_identify_unmarked_headings, - rgx.make_heading_delimiter); + (cast(char[]) dochead_make_identify_unmarked_headings) + .split(rgx.make_heading_delimiter); debug(headingsfound) { writeln(make_headings_spl.length); writeln(make_headings_spl); @@ -2744,7 +2742,7 @@ template SiSUdocAbstraction() { case 7 : if (!empty(make_headings_spl[6])) { heading_match_str["h_4"] = - "^(" ~ to!string(make_headings_spl[6]) ~ ")"; + "^(" ~ make_headings_spl[6].to!string ~ ")"; heading_match_rgx["h_4"] = regex(heading_match_str["h_4"]); } @@ -2752,7 +2750,7 @@ template SiSUdocAbstraction() { case 6 : if (!empty(make_headings_spl[5])) { heading_match_str["h_3"] = - "^(" ~ to!string(make_headings_spl[5]) ~ ")"; + "^(" ~ make_headings_spl[5].to!string ~ ")"; heading_match_rgx["h_3"] = regex(heading_match_str["h_3"]); } @@ -2760,7 +2758,7 @@ template SiSUdocAbstraction() { case 5 : if (!empty(make_headings_spl[4])) { heading_match_str["h_2"] = - "^(" ~ to!string(make_headings_spl[4]) ~ ")"; + "^(" ~ make_headings_spl[4].to!string ~ ")"; heading_match_rgx["h_2"] = regex(heading_match_str["h_2"]); } @@ -2768,7 +2766,7 @@ template SiSUdocAbstraction() { case 4 : if (!empty(make_headings_spl[3])) { heading_match_str["h_1"] = - "^(" ~ to!string(make_headings_spl[3]) ~ ")"; + "^(" ~ make_headings_spl[3].to!string ~ ")"; heading_match_rgx["h_1"] = regex(heading_match_str["h_1"]); } @@ -2776,7 +2774,7 @@ template SiSUdocAbstraction() { case 3 : if (!empty(make_headings_spl[2])) { heading_match_str["h_D"] = - "^(" ~ to!string(make_headings_spl[2]) ~ ")"; + "^(" ~ make_headings_spl[2].to!string ~ ")"; heading_match_rgx["h_D"] = regex(heading_match_str["h_D"]); } @@ -2784,7 +2782,7 @@ template SiSUdocAbstraction() { case 2 : if (!empty(make_headings_spl[1])) { heading_match_str["h_C"] = - "^(" ~ to!string(make_headings_spl[1]) ~ ")"; + "^(" ~ make_headings_spl[1].to!string ~ ")"; heading_match_rgx["h_C"] = regex(heading_match_str["h_C"]); } @@ -2792,7 +2790,7 @@ template SiSUdocAbstraction() { case 1 : if (!empty(make_headings_spl[0])) { heading_match_str["h_B"] = - "^(" ~ to!string(make_headings_spl[0]) ~ ")"; + "^(" ~ make_headings_spl[0].to!string ~ ")"; heading_match_rgx["h_B"] = regex(heading_match_str["h_B"]); } @@ -2821,43 +2819,43 @@ template SiSUdocAbstraction() { && ((type["para"] == State.off) && (type["heading"] == State.off))) { /+ heading make set +/ - if (matchFirst(line, heading_match_rgx["h_B"])) { + if (line.matchFirst(heading_match_rgx["h_B"])) { line = "B~ " ~ line; debug(headingsfound) { writeln(line); } } - if (matchFirst(line, heading_match_rgx["h_C"])) { + if (line.matchFirst(heading_match_rgx["h_C"])) { line = "C~ " ~ line; debug(headingsfound) { writeln(line); } } - if (matchFirst(line, heading_match_rgx["h_D"])) { + if (line.matchFirst(heading_match_rgx["h_D"])) { line = "D~ " ~ line; debug(headingsfound) { writeln(line); } } - if (matchFirst(line, heading_match_rgx["h_1"])) { + if (line.matchFirst(heading_match_rgx["h_1"])) { line = "1~ " ~ line; debug(headingsfound) { writeln(line); } } - if (matchFirst(line, heading_match_rgx["h_2"])) { + if (line.matchFirst(heading_match_rgx["h_2"])) { line = "2~ " ~ line; debug(headingsfound) { writeln(line); } } - if (matchFirst(line, heading_match_rgx["h_3"])) { + if (line.matchFirst(heading_match_rgx["h_3"])) { line = "3~ " ~ line; debug(headingsfound) { writeln(line); } } - if (matchFirst(line, heading_match_rgx["h_4"])) { + if (line.matchFirst(heading_match_rgx["h_4"])) { line = "4~ " ~ line; debug(headingsfound) { writeln(line); @@ -2886,10 +2884,10 @@ template SiSUdocAbstraction() { static assert(is(typeof(dochead_meta_aa) == string[string][string])); } auto rgx = Rgx(); - if (auto m = match(line, rgx.heading)) { + if (auto m = line.match(rgx.heading)) { /+ heading match +/ type["heading"] = State.on; - if (match(line, rgx.heading_seg_and_above)) { + if (line.match(rgx.heading_seg_and_above)) { type["biblio_section"] = State.off; type["glossary_section"] = State.off; type["blurb_section"] = State.off; @@ -2908,7 +2906,7 @@ template SiSUdocAbstraction() { dochead_meta_aa["creator"]["author"]); collapsed_lev["h0"] = 0; an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h0"]); + collapsed_lev["h0"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_A; ++lv["h0"]; lv["h1"] = State.off; @@ -2922,7 +2920,7 @@ template SiSUdocAbstraction() { case "B": collapsed_lev["h1"] = collapsed_lev["h0"] + 1; an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h1"]); + collapsed_lev["h1"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_B; ++lv["h1"]; lv["h2"] = State.off; @@ -2935,7 +2933,7 @@ template SiSUdocAbstraction() { case "C": collapsed_lev["h2"] = collapsed_lev["h1"] + 1; an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h2"]); + collapsed_lev["h2"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_C; ++lv["h2"]; lv["h3"] = State.off; @@ -2947,7 +2945,7 @@ template SiSUdocAbstraction() { case "D": collapsed_lev["h3"] = collapsed_lev["h2"] + 1; an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h3"]); + collapsed_lev["h3"].to!string; lv["lv"] = DocStructMarkupHeading.h_sect_D; ++lv["h3"]; lv["h4"] = State.off; @@ -2966,7 +2964,7 @@ template SiSUdocAbstraction() { collapsed_lev["h4"] = collapsed_lev["h0"] + 1; } an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h4"]); + collapsed_lev["h4"].to!string; lv["lv"] = DocStructMarkupHeading.h_text_1; ++lv["h4"]; lv["h5"] = State.off; @@ -2976,11 +2974,11 @@ template SiSUdocAbstraction() { case "2": if (lv["h5"] > State.off) { an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h5"]); + collapsed_lev["h5"].to!string; } else if (lv["h4"] > State.off) { collapsed_lev["h5"] = collapsed_lev["h4"] + 1; an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h5"]); + collapsed_lev["h5"].to!string; } lv["lv"] = DocStructMarkupHeading.h_text_2; ++lv["h5"]; @@ -2990,11 +2988,11 @@ template SiSUdocAbstraction() { case "3": if (lv["h6"] > State.off) { an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h6"]); + collapsed_lev["h6"].to!string; } else if (lv["h5"] > State.off) { collapsed_lev["h6"] = collapsed_lev["h5"] + 1; an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h6"]); + collapsed_lev["h6"].to!string; } lv["lv"] = DocStructMarkupHeading.h_text_3; ++lv["h6"]; @@ -3003,20 +3001,20 @@ template SiSUdocAbstraction() { case "4": if (lv["h7"] > State.off) { an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h7"]); + collapsed_lev["h7"].to!string; } else if (lv["h6"] > State.off) { collapsed_lev["h7"] = collapsed_lev["h6"] + 1; an_object["lev_collapsed_number"] = - to!string(collapsed_lev["h7"]); + collapsed_lev["h7"].to!string; } lv["lv"] = DocStructMarkupHeading.h_text_4; ++lv["h7"]; goto default; default: - an_object["lev_markup_number"] = to!string(lv["lv"]); + an_object["lev_markup_number"] = lv["lv"].to!string; } debug(heading) { // heading - writeln(strip(line)); + writeln(line.strip); } } } @@ -3049,31 +3047,31 @@ template SiSUdocAbstraction() { "base_position" : 0, ]; bullet = false; - if (auto m = matchFirst(line, rgx.para_indent)) { + if (auto m = line.matchFirst(rgx.para_indent)) { debug(paraindent) { // para indent writeln(line); } - indent["hang_position"] = to!int(m.captures[1]); + indent["hang_position"] = (m.captures[1]).to!int; indent["base_position"] = 0; - } else if (matchFirst(line, rgx.para_bullet)) { + } else if (line.matchFirst(rgx.para_bullet)) { debug(parabullet) { // para bullet writeln(line); } bullet = true; - } else if (auto m = matchFirst(line, rgx.para_indent_hang)) { + } else if (auto m = line.matchFirst(rgx.para_indent_hang)) { debug(paraindenthang) { // para indent hang writeln(line); } indent=[ - "hang_position" : to!int(m.captures[1]), - "base_position" : to!int(m.captures[2]), + "hang_position" : (m.captures[1]).to!int, + "base_position" : (m.captures[2]).to!int, ]; - } else if (auto m = matchFirst(line, rgx.para_bullet_indent)) { + } else if (auto m = line.matchFirst(rgx.para_bullet_indent)) { debug(parabulletindent) { // para bullet indent writeln(line); } indent=[ - "hang_position" : to!int(m.captures[1]), + "hang_position" : (m.captures[1]).to!int, "base_position" : 0, ]; bullet = true; @@ -3085,7 +3083,7 @@ template SiSUdocAbstraction() { return ref T textline, ) { auto rgx = Rgx(); - if (match(textline, rgx.inline_faces_line)) { + if (textline.match(rgx.inline_faces_line)) { textline = (textline) .replaceFirst(rgx.inline_emphasis_line, ("*{$1}*$2")) .replaceFirst(rgx.inline_bold_line, ("!{$1}!$2")) @@ -3134,9 +3132,9 @@ template SiSUdocAbstraction() { static assert(is(typeof(obj_txt_in) == string)); } /+ url matched +/ - if (match(obj_txt_in, rgx.inline_url_generic)) { + if (obj_txt_in.match(rgx.inline_url_generic)) { /+ link: naked url: http://url +/ - if (match(obj_txt_in, rgx.inline_link_naked_url)) { + if (obj_txt_in.match(rgx.inline_link_naked_url)) { obj_txt_in = (obj_txt_in).replaceAll( rgx.inline_link_naked_url, ("$1" @@ -3150,7 +3148,7 @@ template SiSUdocAbstraction() { maps to: { link which includes url as footnote }http://url~{ { http://url }http://url }~ +/ - if (match(obj_txt_in, rgx.inline_link_endnote_url_helper)) { + if (obj_txt_in.match(rgx.inline_link_endnote_url_helper)) { obj_txt_in = (obj_txt_in).replaceAll( rgx.inline_link_endnote_url_helper_punctuated, (mkup.lnk_o ~ "$1" ~ mkup.lnk_c @@ -3171,7 +3169,7 @@ template SiSUdocAbstraction() { /+ link with regular markup: { linked text or image }http://url +/ - if (match(obj_txt_in, rgx.inline_link_markup_regular)) { + if (obj_txt_in.match(rgx.inline_link_markup_regular)) { obj_txt_in = (obj_txt_in).replaceAll( rgx.inline_link_markup_regular, ("$1" @@ -3197,8 +3195,8 @@ template SiSUdocAbstraction() { if (!(stage_reset_note_numbers) && reset_note_numbers) { stage_reset_note_numbers = true; } - if (match(obj_txt_in, rgx.inline_notes_al_gen)) { - if (auto m = matchAll(obj_txt_in, rgx.inline_text_and_note_al_)) { + if (obj_txt_in.match(rgx.inline_notes_al_gen)) { + if (auto m = obj_txt_in.matchAll(rgx.inline_text_and_note_al_)) { if (stage_reset_note_numbers) { n_foot = 0; n_foot_reg = 0; @@ -3207,25 +3205,25 @@ template SiSUdocAbstraction() { } stage_reset_note_numbers = false; foreach(n; m) { - if (match(to!string(n.hit), rgx.inline_al_delimiter_open_symbol_star)) { + if (n.hit.to!string.match(rgx.inline_al_delimiter_open_symbol_star)) { flg_notes_star = true; ++n_foot_sp_asterisk; asterisks_ = "*"; n_foot=n_foot_sp_asterisk; - obj_txt_out ~= (to!string(n.hit)).replaceFirst( + obj_txt_out ~= n.hit.to!string.replaceFirst( rgx.inline_al_delimiter_open_symbol_star, (mkup.en_a_o ~ replicate(asterisks_, n_foot_sp_asterisk) ~ " ") ) ~ "\n"; - } else if (match(to!string(n.hit), rgx.inline_al_delimiter_open_regular)) { + } else if (n.hit.to!string.match(rgx.inline_al_delimiter_open_regular)) { flg_notes_reg = true; ++n_foot_reg; n_foot=n_foot_reg; - obj_txt_out ~= (to!string(n.hit)).replaceFirst( + obj_txt_out ~= n.hit.to!string.replaceFirst( rgx.inline_al_delimiter_open_regular, (mkup.en_a_o ~ to!string(n_foot) ~ " ") ) ~ "\n"; } else { - obj_txt_out ~= to!string(n.hit) ~ "\n"; + obj_txt_out ~= n.hit.to!string ~ "\n"; } } } @@ -3250,19 +3248,16 @@ template SiSUdocAbstraction() { bool urls = false; tail = ""; /+ special endnotes +/ - obj_txt_in = replaceAll( - obj_txt_in, + obj_txt_in = obj_txt_in.replaceAll( rgx.inline_notes_curly_sp_asterisk, (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c) ); - obj_txt_in = - replaceAll( - obj_txt_in, - rgx.inline_notes_curly_sp_plus, - (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) - ); + obj_txt_in = obj_txt_in.replaceAll( + rgx.inline_notes_curly_sp_plus, + (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) + ); /+ url matched +/ - if (match(obj_txt_in, rgx.inline_url)) { + if (obj_txt_in.match(rgx.inline_url)) { urls = true; obj_txt_in = url_links(obj_txt_in); } @@ -3280,7 +3275,7 @@ template SiSUdocAbstraction() { } } auto t = tuple( - to!string(obj_txt_out), + obj_txt_out, ftn[1], ftn[2], urls, @@ -3311,7 +3306,7 @@ template SiSUdocAbstraction() { writeln(__LINE__); writeln(obj_txt_in); writeln(__LINE__); - writeln(to!string(obj_txt["munge"])); + writeln(obj_txt["munge"].to!string); } return t; } @@ -3332,7 +3327,7 @@ template SiSUdocAbstraction() { writeln(__LINE__); writeln(obj_txt_in); writeln(__LINE__); - writeln(to!string(obj_txt["munge"])); + writeln(obj_txt["munge"].to!string); } return t; } @@ -3439,7 +3434,7 @@ template SiSUdocAbstraction() { } body { obj_txt["munge"] = obj_[obj_key_].dup; - obj_txt["munge"] = (match(obj_["is"], ctRegex!(`verse|code`))) + obj_txt["munge"] = (obj_["is"].match(ctRegex!(`verse|code`))) ? obj_txt["munge"] : strip(obj_txt["munge"]); static __gshared string[] anchor_tags_ = []; @@ -3454,7 +3449,7 @@ template SiSUdocAbstraction() { // TODO WORK ON, you still need to ensure that level 1 anchor_tags are unique obj_txt["munge"]=_configured_auto_heading_numbering_and_segment_anchor_tags(obj_txt["munge"], obj_, dochead_make_aa); obj_txt["munge"]=_make_segment_anchor_tags_if_none_provided(obj_txt["munge"], obj_["lev"]); - if (auto m = match(obj_txt["munge"], rgx.heading_anchor_tag)) { + if (auto m = obj_txt["munge"].match(rgx.heading_anchor_tag)) { anchor_tag = m.captures[1]; anchor_tags_ ~= anchor_tag; } else if (obj_["lev"] == "1") { @@ -3516,7 +3511,7 @@ template SiSUdocAbstraction() { debug(asserts) { static assert(is(typeof(heading_toc_) == char[])); } - auto m = matchFirst(cast(char[]) heading_toc_, rgx.heading); + auto m = (cast(char[]) heading_toc_).matchFirst(rgx.heading); heading_toc_ = (m.post).replaceAll( rgx.inline_notes_curly_gen, ""); @@ -3549,10 +3544,10 @@ template SiSUdocAbstraction() { auto attrib=""; string toc_txt_, subtoc_txt_; int[string] indent; - if (to!int(obj_["lev_markup_number"]) > 0) { + if (obj_["lev_markup_number"].to!int > 0) { indent=[ - "hang_position" : to!int(obj_["lev_markup_number"]), - "base_position" : to!int(obj_["lev_markup_number"]), + "hang_position" : obj_["lev_markup_number"].to!int, + "base_position" : obj_["lev_markup_number"].to!int, ]; toc_txt_ = format( "{ %s }#%s", @@ -3569,7 +3564,7 @@ template SiSUdocAbstraction() { comp_obj_toc.indent_hang = indent["hang_position"]; comp_obj_toc.indent_base = indent["base_position"]; comp_obj_toc.bullet = false; - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["scroll"] ~= comp_obj_toc; } else { @@ -3598,7 +3593,7 @@ template SiSUdocAbstraction() { comp_obj_toc.obj_cite_number = ""; comp_obj_toc.bullet = false; comp_obj_toc.inline_links = true; - switch (to!int(obj_["lev_markup_number"])) { + switch (obj_["lev_markup_number"].to!int) { case 0: indent=[ "hang_position" : 0, @@ -3608,14 +3603,14 @@ template SiSUdocAbstraction() { toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.indent_hang = indent["hang_position"]; comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; case 1: .. case 3: indent=[ - "hang_position" : to!int(obj_["lev_markup_number"]), - "base_position" : to!int(obj_["lev_markup_number"]), + "hang_position" : obj_["lev_markup_number"].to!int, + "base_position" : obj_["lev_markup_number"].to!int, ]; toc_txt_ = format( "%s", @@ -3624,7 +3619,7 @@ template SiSUdocAbstraction() { toc_txt_= munge.url_links(toc_txt_); comp_obj_toc.indent_hang = indent["hang_position"]; comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; @@ -3639,12 +3634,12 @@ template SiSUdocAbstraction() { lev4_subtoc[segment_anchor_tag_that_object_belongs_to] = []; toc_txt_= munge.url_links(toc_txt_); indent=[ - "hang_position" : to!int(obj_["lev_markup_number"]), - "base_position" : to!int(obj_["lev_markup_number"]), + "hang_position" : obj_["lev_markup_number"].to!int, + "base_position" : obj_["lev_markup_number"].to!int, ]; comp_obj_toc.indent_hang = indent["hang_position"]; comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; @@ -3663,15 +3658,15 @@ template SiSUdocAbstraction() { _anchor_tag, ); lev4_subtoc[segment_anchor_tag_that_object_belongs_to] - ~= obj_["lev_markup_number"] ~ "~ " ~ to!string(subtoc_txt_).strip; + ~= obj_["lev_markup_number"] ~ "~ " ~ subtoc_txt_.to!string.strip; toc_txt_= munge.url_links(toc_txt_); indent=[ - "hang_position" : to!int(obj_["lev_markup_number"]), - "base_position" : to!int(obj_["lev_markup_number"]), + "hang_position" : obj_["lev_markup_number"].to!int, + "base_position" : obj_["lev_markup_number"].to!int, ]; comp_obj_toc.indent_hang = indent["hang_position"]; comp_obj_toc.indent_base = indent["base_position"]; - comp_obj_toc.text = to!string(toc_txt_).strip; + comp_obj_toc.text = toc_txt_.to!string.strip; comp_obj_toc.inline_links = true; the_table_of_contents_section["seg"] ~= comp_obj_toc; break; @@ -3703,7 +3698,7 @@ template SiSUdocAbstraction() { static __gshared string heading_number_auto_composite = ""; if (heading_num_top_level==9) { if (dochead_make_aa["make"]["num_depth"].length > 0) { - heading_num_depth = to!uint(dochead_make_aa["make"]["num_depth"]); + heading_num_depth = dochead_make_aa["make"]["num_depth"].to!uint; } switch (dochead_make_aa["make"]["num_top"]) { case "A": @@ -3736,7 +3731,7 @@ template SiSUdocAbstraction() { /+ num_depth minimum 0 (1.) default 2 (1.1.1) max 3 (1.1.1.1) implement +/ if ( heading_num_top_level - > to!uint(obj_["lev_markup_number"]) + > obj_["lev_markup_number"].to!uint ) { heading_num_0 = 0; heading_num_1 = 0; @@ -3744,7 +3739,7 @@ template SiSUdocAbstraction() { heading_num_3 = 0; } else if ( heading_num_top_level - == to!uint(obj_["lev_markup_number"]) + == obj_["lev_markup_number"].to!uint ) { heading_num_0 ++; heading_num_1 = 0; @@ -3752,54 +3747,54 @@ template SiSUdocAbstraction() { heading_num_3 = 0; } else if ( heading_num_top_level - == (to!uint(obj_["lev_markup_number"]) - 1) + == (obj_["lev_markup_number"].to!uint - 1) ) { heading_num_1 ++; heading_num_2 = 0; heading_num_3 = 0; } else if ( heading_num_top_level - == (to!uint(obj_["lev_markup_number"]) - 2) + == (obj_["lev_markup_number"].to!uint - 2) ) { heading_num_2 ++; heading_num_3 = 0; } else if ( heading_num_top_level - == (to!uint(obj_["lev_markup_number"]) - 3) + == (obj_["lev_markup_number"].to!uint - 3) ) { heading_num_3 ++; } if (heading_num_3 > 0) { heading_number_auto_composite = (heading_num_depth == 3) - ? ( to!string(heading_num_0) ~ "." - ~ to!string(heading_num_1) ~ "." - ~ to!string(heading_num_2) ~ "." - ~ to!string(heading_num_3) + ? ( heading_num_0.to!string ~ "." + ~ heading_num_1.to!string ~ "." + ~ heading_num_2.to!string ~ "." + ~ heading_num_3.to!string ) : ""; } else if (heading_num_2 > 0) { heading_number_auto_composite = ((heading_num_depth >= 2) && (heading_num_depth <= 3)) - ? ( to!string(heading_num_0) ~ "." - ~ to!string(heading_num_1) ~ "." - ~ to!string(heading_num_2) + ? ( heading_num_0.to!string ~ "." + ~ heading_num_1.to!string ~ "." + ~ heading_num_2.to!string ) : ""; } else if (heading_num_1 > 0) { heading_number_auto_composite = ((heading_num_depth >= 1) && (heading_num_depth <= 3)) - ? ( to!string(heading_num_0) ~ "." - ~ to!string(heading_num_1) + ? ( heading_num_0.to!string ~ "." + ~ heading_num_1.to!string ) : ""; } else if (heading_num_0 > 0) { heading_number_auto_composite = ((heading_num_depth >= 0) && (heading_num_depth <= 3)) - ? (to!string(heading_num_0)) + ? (heading_num_0.to!string) : ""; } else { heading_number_auto_composite = ""; @@ -3807,7 +3802,7 @@ template SiSUdocAbstraction() { debug(heading_number_auto) { writeln(heading_number_auto_composite); } - if (!(match(munge_, rgx.heading_anchor_tag)) + if (!(munge_.match(rgx.heading_anchor_tag)) && !empty(heading_number_auto_composite)) { munge_=(munge_) .replaceFirst(rgx.heading, @@ -3825,13 +3820,13 @@ template SiSUdocAbstraction() { static assert(is(typeof(munge_) == string)); static assert(is(typeof(lev_) == string)); } - if (!(match(munge_, rgx.heading_anchor_tag))) { // if (anchor_tags_.length == 0) { - if (match(munge_, rgx.heading_identify_anchor_tag)) { - if (auto m = match(munge_, rgx.heading_extract_named_anchor_tag)) { + if (!(munge_.match(rgx.heading_anchor_tag))) { + if (munge_.match(rgx.heading_identify_anchor_tag)) { + if (auto m = munge_.match(rgx.heading_extract_named_anchor_tag)) { munge_=(munge_).replaceFirst( rgx.heading_marker_missing_tag, - "$1~" ~ toLower(m.captures[1]) ~ "_" ~ m.captures[2] ~ " "); - } else if (auto m = match(munge_, rgx.heading_extract_unnamed_anchor_tag)) { + "$1~" ~ m.captures[1].toLower ~ "_" ~ m.captures[2] ~ " "); + } else if (auto m = munge_.match(rgx.heading_extract_unnamed_anchor_tag)) { munge_=(munge_).replaceFirst( rgx.heading_marker_missing_tag, "$1~" ~ "s" ~ m.captures[1] ~ " "); @@ -3841,7 +3836,7 @@ template SiSUdocAbstraction() { heading_num_lev1 ++; munge_=(munge_).replaceFirst( rgx.heading_marker_missing_tag, - "$1~" ~ "x" ~ to!string(heading_num_lev1) ~ " "); + "$1~" ~ "x" ~ heading_num_lev1.to!string ~ " "); } } return munge_; @@ -3972,22 +3967,22 @@ template SiSUdocAbstraction() { } } body { - if (matchFirst(obj_txt_in, rgx.para_bullet)) { + if (obj_txt_in.matchFirst(rgx.para_bullet)) { _obj_attributes =" \"bullet\": \"true\"," ~ " \"indent_hang\": 0," ~ " \"indent_base\": 0,"; - } else if (auto m = matchFirst(obj_txt_in, rgx.para_bullet_indent)) { + } else if (auto m = obj_txt_in.matchFirst(rgx.para_bullet_indent)) { _obj_attributes =" \"bullet\": \"true\"," - ~ " \"indent_hang\": " ~ to!string(m.captures[1]) ~ "," - ~ " \"indent_base\": " ~ to!string(m.captures[1]) ~ ","; - } else if (auto m = matchFirst(obj_txt_in, rgx.para_indent_hang)) { + ~ " \"indent_hang\": " ~ m.captures[1].to!string ~ "," + ~ " \"indent_base\": " ~ m.captures[1].to!string ~ ","; + } else if (auto m = obj_txt_in.matchFirst(rgx.para_indent_hang)) { _obj_attributes =" \"bullet\": \"false\"," - ~ " \"indent_hang\": " ~ to!string(m.captures[1]) ~ "," - ~ " \"indent_base\": " ~ to!string(m.captures[2]) ~ ","; - } else if (auto m = matchFirst(obj_txt_in, rgx.para_indent)) { + ~ " \"indent_hang\": " ~ m.captures[1].to!string ~ "," + ~ " \"indent_base\": " ~ m.captures[2].to!string ~ ","; + } else if (auto m = obj_txt_in.matchFirst(rgx.para_indent)) { _obj_attributes =" \"bullet\": \"false\"," - ~ " \"indent_hang\": " ~ to!string(m.captures[1]) ~ "," - ~ " \"indent_base\": " ~ to!string(m.captures[1]) ~ ","; + ~ " \"indent_hang\": " ~ m.captures[1].to!string ~ "," + ~ " \"indent_base\": " ~ m.captures[1].to!string ~ ","; } else { _obj_attributes =" \"bullet\": \"false\"," ~ " \"indent_hang\": 0," @@ -4172,7 +4167,7 @@ template SiSUdocAbstraction() { if (!bookindex_section.empty) { writeln( "* [bookindex] ", - "[", to!string(obj_cite_number), ": ", segment_anchor_tag, "] ", bookindex_section + "[", obj_cite_number.to!string, ": ", segment_anchor_tag, "] ", bookindex_section ); } } @@ -4181,41 +4176,39 @@ template SiSUdocAbstraction() { auto rgx = Rgx(); if (!bookindex_section.empty) { auto bi_main_terms_split_arr = - split(bookindex_section, rgx.bi_main_terms_split); + bookindex_section.split(rgx.bi_main_terms_split); foreach (bi_main_terms_content; bi_main_terms_split_arr) { auto bi_main_term_and_rest = - split(bi_main_terms_content, rgx.bi_main_term_plus_rest_split); - if (auto m = match( - bi_main_term_and_rest[0], + bi_main_terms_content.split(rgx.bi_main_term_plus_rest_split); + if (auto m = bi_main_term_and_rest[0].match( rgx.bi_term_and_obj_cite_numbers_match) ) { - main_term = strip(m.captures[1]); - obj_cite_number_offset = to!int(m.captures[2]); + main_term = m.captures[1].strip; + obj_cite_number_offset = m.captures[2].to!int; obj_cite_number_endpoint=(obj_cite_number + obj_cite_number_offset); - obj_cite_numbers ~= (to!string(obj_cite_number) ~ "-" ~ to!string(obj_cite_number_endpoint) + obj_cite_numbers ~= (obj_cite_number.to!string ~ "-" ~ to!string(obj_cite_number_endpoint) ~ ":" ~ segment_anchor_tag); } else { - main_term = strip(bi_main_term_and_rest[0]); - obj_cite_numbers ~= to!string(obj_cite_number) + main_term = bi_main_term_and_rest[0].strip; + obj_cite_numbers ~= obj_cite_number.to!string ~ ":" ~ segment_anchor_tag; } bi[main_term]["_a"] ~= obj_cite_numbers; obj_cite_numbers=null; if (bi_main_term_and_rest.length > 1) { auto bi_sub_terms_split_arr = - split( - bi_main_term_and_rest[1], + bi_main_term_and_rest[1].split( rgx.bi_sub_terms_plus_obj_cite_number_offset_split ); foreach (sub_terms_bits; bi_sub_terms_split_arr) { - if (auto m = match(sub_terms_bits, rgx.bi_term_and_obj_cite_numbers_match)) { - sub_term = strip(m.captures[1]); - obj_cite_number_offset = to!int(m.captures[2]); + if (auto m = sub_terms_bits.match(rgx.bi_term_and_obj_cite_numbers_match)) { + sub_term = m.captures[1].strip; + obj_cite_number_offset = m.captures[2].to!int; obj_cite_number_endpoint=(obj_cite_number + obj_cite_number_offset); - obj_cite_numbers ~= (to!string(obj_cite_number) ~ " - " ~ to!string(obj_cite_number_endpoint) + obj_cite_numbers ~= (obj_cite_number.to!string ~ " - " ~ to!string(obj_cite_number_endpoint) ~ ":" ~ segment_anchor_tag); } else { - sub_term = strip(sub_terms_bits); + sub_term = sub_terms_bits.strip; obj_cite_numbers ~= to!string(obj_cite_number) ~ ":" ~ segment_anchor_tag; } @@ -4371,7 +4364,7 @@ template SiSUdocAbstraction() { bi_tmp_seg = "!{" ~ mainkey ~ "}! "; auto bkidx_lnk_seg(string locs) { string markup = ""; - if (auto m = matchFirst(locs, rgx.book_index_go_seg)) { + if (auto m = locs.matchFirst(rgx.book_index_go_seg)) { markup = munge.url_links("{ " ~ m["link"] ~ " }" ~ mkup.mark_internal_site_lnk ~ m["seg"] ~ ".fnSuffix" @@ -4383,7 +4376,7 @@ template SiSUdocAbstraction() { } auto bkidx_lnk_scroll(string locs) { string markup = ""; - if (auto m = matchFirst(locs, rgx.book_index_go)) { + if (auto m = locs.matchFirst(rgx.book_index_go)) { markup = munge.url_links("{ " ~ m["link"] ~ " }" ~ mkup.mark_internal_site_lnk @@ -4421,7 +4414,7 @@ template SiSUdocAbstraction() { comp_obj_para.use = "backmatter"; comp_obj_para.is_of = "para"; comp_obj_para.is_a = "bookindex"; - comp_obj_para.text = to!string(bi_tmp_scroll).strip; + comp_obj_para.text = bi_tmp_scroll.to!string.strip; comp_obj_para.ocn = obj_cite_number; comp_obj_para.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); comp_obj_para.anchor_tags = bi_tmp_tags; @@ -4430,7 +4423,7 @@ template SiSUdocAbstraction() { comp_obj_para.bullet = false; comp_obj_para.inline_links = true; bookindex_section["scroll"] ~= comp_obj_para; - comp_obj_para.text = to!string(bi_tmp_seg).strip; + comp_obj_para.text = bi_tmp_seg.to!string.strip; bookindex_section["seg"] ~= comp_obj_para; ++obj_cite_number; ++mkn; @@ -4470,7 +4463,7 @@ template SiSUdocAbstraction() { assert(cntr >= previous_count); previous_count=cntr; assert( - match(contents_am[cntr].text, + (contents_am[cntr].text).match( rgx.inline_notes_delimiter_al_regular_number_note) ); } @@ -4480,8 +4473,7 @@ template SiSUdocAbstraction() { auto munge = ObjInlineMarkupMunge(); foreach( m; - matchAll( - contents_am[cntr].text, + (contents_am[cntr].text).matchAll( rgx.inline_notes_delimiter_al_regular_number_note ) ) { @@ -4518,8 +4510,8 @@ template SiSUdocAbstraction() { body { string[][string] endnotes_; if (object_notes.length > 1) { - endnotes_["notes"] = (split(object_notes["notes"], rgx.break_string))[0..$-1]; - endnotes_["anchor"] = (split(object_notes["anchor"], rgx.break_string))[0..$-1]; + endnotes_["notes"] = (object_notes["notes"].split(rgx.break_string))[0..$-1]; + endnotes_["anchor"] = (object_notes["anchor"].split(rgx.break_string))[0..$-1]; } else { endnotes_["notes"] = []; endnotes_["anchor"] = []; @@ -4602,8 +4594,8 @@ template SiSUdocAbstraction() { comp_obj_endnote_.indent_base = 0; comp_obj_endnote_.bullet = false; foreach (i, endnote; endnotes_["notes"]) { - auto m = (matchFirst(endnote, rgx.note_ref)); - string notenumber = to!string(m.captures[1]); + auto m = endnote.matchFirst(rgx.note_ref); + string notenumber = m.captures[1].to!string; string anchor_tag = "note_" ~ notenumber; comp_obj_endnote_.anchor_tags = [ endnotes_["anchor"][i] ]; comp_obj_endnote_.inline_links = true; @@ -4738,12 +4730,12 @@ template SiSUdocAbstraction() { static assert(is(typeof(is_) == string)); } assert(is_ != "heading"); - assert(to!int(obj_cite_number_) >= 0); + assert(obj_cite_number_.to!int >= 0); } body { assert(is_ != "heading"); // should not be necessary - assert(to!int(obj_cite_number_) >= 0); // should not be necessary - int obj_cite_number=to!int(obj_cite_number_); + assert(obj_cite_number_.to!int >= 0); // should not be necessary + int obj_cite_number = obj_cite_number_.to!int; if (lv7 > State.off) { p_["lev_markup_number"] = DocStructMarkupHeading.h_text_4; p_["obj_cite_number"] = lv7; @@ -4761,14 +4753,14 @@ template SiSUdocAbstraction() { comp_obj_location = comp_obj_location.init; comp_obj_location.is_a = is_; comp_obj_location.ocn = obj_cite_number_; - comp_obj_location.segment_anchor_tag = to!string(segment_anchor_tag); + comp_obj_location.segment_anchor_tag = segment_anchor_tag.to!string; comp_obj_location.parent_ocn = p_["obj_cite_number"]; comp_obj_location.parent_lev_markup = p_["lev_markup_number"]; debug(node) { - if (match(lev_markup_number, rgx.levels_numbered_headings)) { - writeln("x ", to!string(_node)); + if (lev_markup_number.match(rgx.levels_numbered_headings)) { + writeln("x ", _node.to!string); } else { - writeln("- ", to!string(_node)); + writeln("- ", _node.to!string); } } assert(comp_obj_location.parent_lev_markup >= 4); @@ -4811,18 +4803,18 @@ template SiSUdocAbstraction() { assert(is_ == "heading"); assert(to!int(obj_cite_number_) >= 0); assert( - match(lev_markup_number, rgx.levels_numbered), - ("not a valid heading level: " ~ lev_markup_number ~ " at " ~ to!string(obj_cite_number_)) + lev_markup_number.match(rgx.levels_numbered), + ("not a valid heading level: " ~ lev_markup_number ~ " at " ~ obj_cite_number_.to!string) ); - if (match(lev_markup_number, rgx.levels_numbered)) { - if (to!int(lev_markup_number) == 0) { - assert(to!int(obj_cite_number_) == 1); + if (lev_markup_number.match(rgx.levels_numbered)) { + if (lev_markup_number.to!int == 0) { + assert(obj_cite_number_.to!int == 1); } } } body { - int obj_cite_number = to!int(obj_cite_number_); - switch (to!int(lev_markup_number)) { + int obj_cite_number = obj_cite_number_.to!int; + switch (lev_markup_number.to!int) { case 0: lv = DocStructMarkupHeading.h_sect_A; lv0 = obj_cite_number; @@ -4907,13 +4899,13 @@ template SiSUdocAbstraction() { _comp_obj_heading_.use = "body"; _comp_obj_heading_.is_of = "para"; _comp_obj_heading_.is_a = "heading"; - _comp_obj_heading_.text = to!string(_text).strip; + _comp_obj_heading_.text = _text.to!string.strip; _comp_obj_heading_.ocn = obj_cite_number_; - _comp_obj_heading_.obj_cite_number = (obj_cite_number==0) ? "" : to!string(obj_cite_number); - _comp_obj_heading_.segment_anchor_tag = to!string(segment_anchor_tag); + _comp_obj_heading_.obj_cite_number = (obj_cite_number==0) ? "" : obj_cite_number.to!string; + _comp_obj_heading_.segment_anchor_tag = segment_anchor_tag.to!string; _comp_obj_heading_.marked_up_level = lev; - _comp_obj_heading_.heading_lev_markup = (!(lev_markup_number.empty) ? to!int(lev_markup_number) : 0); - _comp_obj_heading_.heading_lev_collapsed = (!(lev_collapsed_number.empty) ? to!int(lev_collapsed_number) : 0); + _comp_obj_heading_.heading_lev_markup = (!(lev_markup_number.empty) ? lev_markup_number.to!int : 0); + _comp_obj_heading_.heading_lev_collapsed = (!(lev_collapsed_number.empty) ? lev_collapsed_number.to!int : 0); _comp_obj_heading_.parent_ocn = p_["obj_cite_number"]; _comp_obj_heading_.parent_lev_markup = p_["lev_markup_number"]; _comp_obj_heading_.heading_ancestors_text = lv_ancestors; @@ -4924,18 +4916,18 @@ template SiSUdocAbstraction() { _comp_obj_heading_.inline_notes_star = flag_notes_star; _comp_obj_heading_.inline_links = flag_links; debug(node) { - if (match(lev_markup_number, rgx.levels_numbered_headings)) { - writeln("* ", to!string(_node)); + if (lev_markup_number.match(rgx.levels_numbered_headings)) { + writeln("* ", _node.to!string); } } debug(nodeheading) { - if (match(lev_markup_number, rgx.levels_numbered_headings)) { - writeln("* ", to!string(_node)); + if (lev_markup_number.match(rgx.levels_numbered_headings)) { + writeln("* ", _node.to!string); } } assert(_comp_obj_heading_.parent_lev_markup <= 7); assert(_comp_obj_heading_.parent_ocn >= 0); - if (match(lev_markup_number, rgx.levels_numbered_headings)) { + if (lev_markup_number.match(rgx.levels_numbered_headings)) { assert(_comp_obj_heading_.heading_lev_markup <= 7); assert(_comp_obj_heading_.ocn >= 0); if (_comp_obj_heading_.parent_lev_markup > 0) { @@ -5054,7 +5046,7 @@ template SiSUdocAbstraction() { } if (lv["h7"] == State.off) { } - switch (to!string(an_object["lev"])) { + switch ((an_object["lev"]).to!string) { case "A": if (lv["h0"] == State.off) { assert(lv["h1"] == State.off); -- cgit v1.2.3