diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-03-07 09:11:09 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 5a4df097b2976c24c449c56cf035995edfb1261e (patch) | |
tree | 9112c6f32f1b9a8d7cdc7849754d6b8f602de0c5 /org/ao_doc_abstraction.org | |
parent | org files minor touches (diff) |
0.13.6 dlang function calls, syntax (ufcs related), logic should be retained
Diffstat (limited to 'org/ao_doc_abstraction.org')
-rw-r--r-- | org/ao_doc_abstraction.org | 576 |
1 files changed, 284 insertions, 292 deletions
diff --git a/org/ao_doc_abstraction.org b/org/ao_doc_abstraction.org index 2188e94..aac99f7 100644 --- a/org/ao_doc_abstraction.org +++ b/org/ao_doc_abstraction.org @@ -136,7 +136,7 @@ template SiSUdocAbstraction() { } else { /+ not within a block group +/ <<abs_in_loop_body_open_block_obj_assert>> - if (matchFirst(line, rgx.block_open)) { + if (line.matchFirst(rgx.block_open)) { <<abs_in_loop_body_open_block_obj>> } else if (!line.empty) { /+ line not empty +/ @@ -319,47 +319,47 @@ void heading_ancestors(O)( ) { 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; @@ -647,11 +647,11 @@ continue; #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -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; @@ -677,11 +677,11 @@ if there is a glossary section you need to: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -} 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__); @@ -700,7 +700,7 @@ if there is a glossary section you need to: 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"; @@ -735,7 +735,7 @@ if there is a glossary section you need to: 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"]; @@ -759,11 +759,11 @@ if there is a blurb section you need to: #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -} 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__); @@ -781,7 +781,7 @@ if there is a blurb section you need to: 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"; @@ -810,19 +810,19 @@ if there is a blurb section you need to: 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_; @@ -832,7 +832,7 @@ if there is a blurb section you need to: 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"]; @@ -914,11 +914,11 @@ assertions_flag_types_block_status_none_or_closed(type); #+name: abs_in_loop_body_open_block_obj #+BEGIN_SRC d -if (matchFirst(line, (rgx.block_poem_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; @@ -945,8 +945,8 @@ if (type["blocks"] == TriState.closing) { 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 ); } @@ -956,9 +956,9 @@ if (type["blocks"] == TriState.closing) { #+name: abs_in_loop_body_not_block_obj #+BEGIN_SRC d -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); #+END_SRC @@ -1022,7 +1022,7 @@ if ((matchFirst(line, rgx.book_index)) - 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) { @@ -1101,7 +1101,7 @@ assert( 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"; @@ -1110,14 +1110,14 @@ if ((type["heading"] == State.on) 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 = ""; } @@ -1204,9 +1204,9 @@ if ((type["heading"] == State.on) 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; @@ -1248,12 +1248,11 @@ if (the_document_body_section.length > 0) { 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, @@ -1409,7 +1408,7 @@ foreach (entry; biblio_ordered) { 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; @@ -1536,7 +1535,7 @@ if (the_endnotes_section.length > 1) { ".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; } @@ -1549,7 +1548,7 @@ if (the_glossary_section.length > 1) { ".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( @@ -1558,7 +1557,7 @@ if (the_glossary_section.length > 1) { "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; } @@ -1571,7 +1570,7 @@ if (the_bibliography_section.length > 1){ ".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; @@ -1581,7 +1580,7 @@ if (the_bibliography_section.length > 1){ "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; } @@ -1594,7 +1593,7 @@ if (the_bookindex_section["seg"].length > 1) { ".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; } @@ -1605,7 +1604,7 @@ if (the_bookindex_section["scroll"].length > 1) { "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; } @@ -1618,7 +1617,7 @@ if (the_blurb_section.length > 1) { ".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( @@ -1628,7 +1627,7 @@ if (the_blurb_section.length > 1) { ); 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) { @@ -1763,7 +1762,7 @@ next are not yet known for backmatter during the second pass 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_; @@ -2221,15 +2220,15 @@ void _check_ocn_status_(L,T)( 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); @@ -2237,9 +2236,9 @@ void _check_ocn_status_(L,T)( } } 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; @@ -2250,7 +2249,7 @@ void _check_ocn_status_(L,T)( } } } 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) { @@ -2284,7 +2283,7 @@ void _start_block_(L,T,N)( #+name: abs_functions_block #+BEGIN_SRC d 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( @@ -2295,7 +2294,7 @@ void _start_block_(L,T,N)( 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( @@ -2304,12 +2303,12 @@ void _start_block_(L,T,N)( ); } 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( @@ -2320,7 +2319,7 @@ void _start_block_(L,T,N)( 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( @@ -2331,7 +2330,7 @@ void _start_block_(L,T,N)( 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( @@ -2342,7 +2341,7 @@ void _start_block_(L,T,N)( 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( @@ -2359,7 +2358,7 @@ void _start_block_(L,T,N)( #+name: abs_functions_block #+BEGIN_SRC d - } 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( @@ -2370,7 +2369,7 @@ void _start_block_(L,T,N)( 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( @@ -2378,12 +2377,12 @@ void _start_block_(L,T,N)( 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( @@ -2394,7 +2393,7 @@ void _start_block_(L,T,N)( 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( @@ -2405,7 +2404,7 @@ void _start_block_(L,T,N)( 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( @@ -2416,7 +2415,7 @@ void _start_block_(L,T,N)( 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( @@ -2454,7 +2453,7 @@ void _code_block_(L,O,T)( } 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); } @@ -2468,7 +2467,7 @@ void _code_block_(L,O,T)( 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); } @@ -2588,7 +2587,7 @@ void _biblio_block_( 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; @@ -2623,16 +2622,16 @@ void _biblio_block_( 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; @@ -2643,11 +2642,11 @@ void _biblio_block_( 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; @@ -2658,11 +2657,11 @@ void _biblio_block_( 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; @@ -2685,7 +2684,7 @@ void _biblio_block_( j[biblio_tag_name] ); } - if ((match(line, rgx.comment))) { + if (line.match(rgx.comment)) { writeln("ERROR", line, "COMMENT"); writeln("ERROR", s, "%%"); } @@ -2718,7 +2717,7 @@ void _group_block_(L,O,T)( } 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); } @@ -2732,7 +2731,7 @@ void _group_block_(L,O,T)( 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); } @@ -2765,7 +2764,7 @@ void _block_block_(L,O,T)( } 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); } @@ -2779,7 +2778,7 @@ void _block_block_(L,O,T)( 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); } @@ -2820,7 +2819,7 @@ void _poem_block_(L,O,T,C,N,Ma)( } 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( @@ -2856,7 +2855,7 @@ void _poem_block_(L,O,T,C,N,Ma)( 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]; @@ -2867,7 +2866,7 @@ void _poem_block_(L,O,T,C,N,Ma)( ++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; @@ -2877,7 +2876,7 @@ void _poem_block_(L,O,T,C,N,Ma)( 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; } @@ -2910,7 +2909,7 @@ void _poem_block_(L,O,T,C,N,Ma)( 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]; @@ -2922,7 +2921,7 @@ void _poem_block_(L,O,T,C,N,Ma)( } } } 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( @@ -2949,13 +2948,13 @@ void _poem_block_(L,O,T,C,N,Ma)( 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; @@ -2969,7 +2968,7 @@ void _poem_block_(L,O,T,C,N,Ma)( 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; } @@ -3003,7 +3002,7 @@ void _poem_block_(L,O,T,C,N,Ma)( 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]; @@ -3034,7 +3033,7 @@ void _quote_block_(L,O,T)( } 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); } @@ -3048,7 +3047,7 @@ void _quote_block_(L,O,T)( 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); } @@ -3081,7 +3080,7 @@ void _table_block_(L,O,T)( } 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); } @@ -3095,7 +3094,7 @@ void _table_block_(L,O,T)( 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); } @@ -3177,7 +3176,7 @@ void _block_flag_line_empty_(B)( 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]; @@ -3223,7 +3222,7 @@ void _block_flag_line_empty_(B)( 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]; @@ -3270,7 +3269,7 @@ void _block_flag_line_empty_(B)( 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]; @@ -3354,7 +3353,7 @@ void _block_flag_line_empty_(B)( 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]; @@ -3401,7 +3400,7 @@ void _block_flag_line_empty_(B)( 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]; @@ -3441,20 +3440,20 @@ auto _book_index_(L,I,O,T,B)( 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", @@ -3464,11 +3463,11 @@ auto _book_index_(L,I,O,T,B)( } } 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", @@ -3514,9 +3513,8 @@ auto _heading_found_(L,X,H,R,T)( 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); @@ -3525,7 +3523,7 @@ auto _heading_found_(L,X,H,R,T)( 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"]); } @@ -3533,7 +3531,7 @@ auto _heading_found_(L,X,H,R,T)( 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"]); } @@ -3541,7 +3539,7 @@ auto _heading_found_(L,X,H,R,T)( 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"]); } @@ -3549,7 +3547,7 @@ auto _heading_found_(L,X,H,R,T)( 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"]); } @@ -3557,7 +3555,7 @@ auto _heading_found_(L,X,H,R,T)( 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"]); } @@ -3565,7 +3563,7 @@ auto _heading_found_(L,X,H,R,T)( 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"]); } @@ -3573,7 +3571,7 @@ auto _heading_found_(L,X,H,R,T)( 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"]); } @@ -3608,43 +3606,43 @@ auto _heading_make_set_(L,C,R,T)( && ((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); @@ -3679,10 +3677,10 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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; @@ -3701,7 +3699,7 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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; @@ -3715,7 +3713,7 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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; @@ -3728,7 +3726,7 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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; @@ -3740,7 +3738,7 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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; @@ -3759,7 +3757,7 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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; @@ -3769,11 +3767,11 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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"]; @@ -3783,11 +3781,11 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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"]; @@ -3796,20 +3794,20 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,Me)( 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); } } } @@ -3848,31 +3846,31 @@ void _para_match_(L,O,K,I,B,T,C)( "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; @@ -3890,7 +3888,7 @@ auto font_faces_line(T)( 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")) @@ -3958,9 +3956,9 @@ struct ObjInlineMarkupMunge { 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" @@ -3974,7 +3972,7 @@ struct ObjInlineMarkupMunge { 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 @@ -3995,7 +3993,7 @@ struct ObjInlineMarkupMunge { /+ 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" @@ -4027,8 +4025,8 @@ struct ObjInlineMarkupMunge { 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; @@ -4037,25 +4035,25 @@ struct ObjInlineMarkupMunge { } 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"; } } } @@ -4086,19 +4084,16 @@ struct ObjInlineMarkupMunge { 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); } @@ -4116,7 +4111,7 @@ struct ObjInlineMarkupMunge { } } auto t = tuple( - to!string(obj_txt_out), + obj_txt_out, ftn[1], ftn[2], urls, @@ -4155,7 +4150,7 @@ struct ObjInlineMarkupMunge { writeln(__LINE__); writeln(obj_txt_in); writeln(__LINE__); - writeln(to!string(obj_txt["munge"])); + writeln(obj_txt["munge"].to!string); } return t; } @@ -4188,7 +4183,7 @@ struct ObjInlineMarkupMunge { writeln(__LINE__); writeln(obj_txt_in); writeln(__LINE__); - writeln(to!string(obj_txt["munge"])); + writeln(obj_txt["munge"].to!string); } return t; } @@ -4385,7 +4380,7 @@ struct ObjInlineMarkup { } 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_ = []; @@ -4400,7 +4395,7 @@ struct ObjInlineMarkup { // 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") { @@ -4468,7 +4463,7 @@ struct ObjInlineMarkup { 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, ""); @@ -4501,10 +4496,10 @@ struct ObjInlineMarkup { 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", @@ -4521,7 +4516,7 @@ struct ObjInlineMarkup { 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 { @@ -4550,7 +4545,7 @@ struct ObjInlineMarkup { 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, @@ -4560,14 +4555,14 @@ struct ObjInlineMarkup { 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", @@ -4576,7 +4571,7 @@ struct ObjInlineMarkup { 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; @@ -4591,12 +4586,12 @@ struct ObjInlineMarkup { 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; @@ -4615,15 +4610,15 @@ struct ObjInlineMarkup { _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; @@ -4667,7 +4662,7 @@ private: 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": @@ -4700,7 +4695,7 @@ private: /+ 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; @@ -4708,7 +4703,7 @@ private: 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; @@ -4716,54 +4711,54 @@ private: 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 = ""; @@ -4771,7 +4766,7 @@ private: 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, @@ -4800,13 +4795,13 @@ private: 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] ~ " "); @@ -4816,7 +4811,7 @@ private: 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_; @@ -4984,22 +4979,22 @@ struct ObjAttributes { } } 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," @@ -5256,7 +5251,7 @@ struct BookIndexNuggetHash { 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 ); } } @@ -5265,41 +5260,39 @@ struct BookIndexNuggetHash { 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; } @@ -5480,7 +5473,7 @@ struct BookIndexReportSection { 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" @@ -5492,7 +5485,7 @@ struct BookIndexReportSection { } 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 @@ -5530,7 +5523,7 @@ struct BookIndexReportSection { 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; @@ -5539,7 +5532,7 @@ struct BookIndexReportSection { 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; @@ -5596,7 +5589,7 @@ struct NotesSection { 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) ); } @@ -5606,8 +5599,7 @@ struct NotesSection { auto munge = ObjInlineMarkupMunge(); foreach( m; - matchAll( - contents_am[cntr].text, + (contents_am[cntr].text).matchAll( rgx.inline_notes_delimiter_al_regular_number_note ) ) { @@ -5650,8 +5642,8 @@ struct NotesSection { 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"] = []; @@ -5740,8 +5732,8 @@ struct NotesSection { 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; @@ -5930,12 +5922,12 @@ struct NodeStructureMetadata { 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; @@ -5953,14 +5945,14 @@ struct NodeStructureMetadata { 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); @@ -6009,18 +6001,18 @@ struct NodeStructureMetadata { 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; @@ -6105,13 +6097,13 @@ struct NodeStructureMetadata { _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; @@ -6122,18 +6114,18 @@ struct NodeStructureMetadata { _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) { @@ -6263,7 +6255,7 @@ auto assertions_doc_structure(O,Lv)( } 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); |