From ed71ef0ac032456c882bea44b04c02863cb90a46 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 25 Jan 2020 13:34:47 -0500 Subject: code ctRegex calls, tidying --- src/doc_reform/io_in/paths_source.d | 20 ++++----- src/doc_reform/io_in/read_config_files.d | 8 ++-- src/doc_reform/io_in/read_source_files.d | 10 ++--- src/doc_reform/io_out/epub3.d | 10 ++--- src/doc_reform/io_out/html.d | 12 ++--- src/doc_reform/io_out/hub.d | 8 ++-- src/doc_reform/io_out/latex.d | 4 +- src/doc_reform/io_out/odt.d | 10 ++--- src/doc_reform/io_out/paths_output.d | 32 ++++++------- src/doc_reform/io_out/rgx.d | 5 +-- src/doc_reform/io_out/source_pod.d | 4 +- src/doc_reform/io_out/sqlite.d | 6 +-- src/doc_reform/io_out/xmls.d | 4 +- src/doc_reform/meta/conf_make_meta_json.d | 4 +- src/doc_reform/meta/conf_make_meta_structs.d | 4 +- src/doc_reform/meta/conf_make_meta_yaml.d | 8 ++-- src/doc_reform/meta/defaults.d | 2 +- src/doc_reform/meta/doc_debugs.d | 4 +- src/doc_reform/meta/metadoc.d | 6 +-- src/doc_reform/meta/metadoc_from_src.d | 62 +++++++++++++------------- src/doc_reform/meta/metadoc_harvests_authors.d | 1 - src/doc_reform/meta/metadoc_harvests_topics.d | 1 - src/doc_reform/meta/rgx.d | 4 +- src/doc_reform/spine.d | 6 +-- 24 files changed, 116 insertions(+), 119 deletions(-) (limited to 'src/doc_reform') diff --git a/src/doc_reform/io_in/paths_source.d b/src/doc_reform/io_in/paths_source.d index f3b1e8a..85738d1 100644 --- a/src/doc_reform/io_in/paths_source.d +++ b/src/doc_reform/io_in/paths_source.d @@ -14,8 +14,8 @@ import doc_reform.meta.defaults, doc_reform.meta.rgx; template PodManifest() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); @safe auto PodManifest(O)( O _opt_actions, string _pth="" @@ -67,9 +67,9 @@ template PodManifest() { } } template PathMatters() { - mixin spineRgxInit; + mixin spineRgxIn; mixin InternalMarkup; - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto mkup = InlineMarkup(); @safe auto PathMatters(O,E)( O _opt_actions, @@ -409,8 +409,8 @@ template PathMatters() { } } template ConfigFilePaths() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); @safe auto ConfigFilePaths(M,E)( M _manifested, E _env, @@ -531,8 +531,8 @@ template ConfigFilePaths() { } } template spinePathsSRC() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); @safe auto spinePathsSRC(D,Fn)( D _pwd, Fn _fn_src_and_path, @@ -582,8 +582,8 @@ template spinePathsSRC() { template spinePathsPods() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); string _suffix = ".zip"; auto spinePathsPods(M)(M doc_matters) { string _base_dir_pod = (doc_matters.output_path.length > 0) diff --git a/src/doc_reform/io_in/read_config_files.d b/src/doc_reform/io_in/read_config_files.d index 4889e4f..9daf362 100644 --- a/src/doc_reform/io_in/read_config_files.d +++ b/src/doc_reform/io_in/read_config_files.d @@ -13,8 +13,8 @@ import template readConfigSite() { @system final auto readConfigSite(C)(C _conf_file_details) { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); string conf_filename = "NONE"; string config_file_str; string default_config_file_str = format(q"┃ @@ -117,8 +117,8 @@ static template readConfigDoc() { doc_reform.io_in.paths_source, doc_reform.meta.rgx; @system final auto readConfigDoc(M,E)(M _manifested, E _env) { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); string config_file_str; string conf_filename = "NONE"; auto _conf_file_details = ConfigFilePaths!()(_manifested, _env); diff --git a/src/doc_reform/io_in/read_source_files.d b/src/doc_reform/io_in/read_source_files.d index 041ec91..7d826a9 100644 --- a/src/doc_reform/io_in/read_source_files.d +++ b/src/doc_reform/io_in/read_source_files.d @@ -11,8 +11,8 @@ template spineRawMarkupContent() { doc_reform.meta, doc_reform.io_in.paths_source, doc_reform.meta.rgx; - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); string[] _images=[]; @safe string[] _extract_images(S)(S content_block) { string[] images_; @@ -125,7 +125,7 @@ template spineRawMarkupContent() { return source_line_arr; } @safe string markupSourceReadIn(in string fn_src) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); enforce( fn_src.match(rgx.src_pth_sst_or_ssm), "not a dr markup filename: «" ~ @@ -173,7 +173,7 @@ template spineRawMarkupContent() { char[][] markup_sourcefile_insert_content, string fn_src ) { - mixin spineRgxInitFlags; + mixin spineRgxDocStructFlags; char[][] contents_insert; int[string] type1 = flags_type_init; auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm); @@ -259,7 +259,7 @@ template spineRawMarkupContent() { string fn_src ) { import std.algorithm; - mixin spineRgxInitFlags; + mixin spineRgxDocStructFlags; char[][] contents; int[string] type = flags_type_init; auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm); diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d index f8f5ba4..9d29968 100644 --- a/src/doc_reform/io_out/epub3.d +++ b/src/doc_reform/io_out/epub3.d @@ -131,7 +131,7 @@ template outputEPub3() { @safe string epub3_oebps_toc_nav_xhtml(D,I)(D doc_abstraction, I doc_matters) { enum DomTags { none, open, close, close_and_open, open_still, } auto markup = InlineMarkup(); - static auto rgx = Rgx(); + static auto rgx = RgxO(); string toc =format(" @@ -211,7 +211,7 @@ template outputEPub3() { int counter = 0; string _uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO shared elsewhere auto markup = InlineMarkup(); - static auto rgx = Rgx(); + static auto rgx = RgxO(); enum DomTags { none, open, close, close_and_open, open_still, } string toc = format(q"┃ @@ -301,9 +301,9 @@ template outputEPub3() { const D doc_abstraction, I doc_matters, ) { - mixin spineOutputRgxInit; + mixin spineRgxOut; auto xhtml_format = outputXHTMLs(); - static auto rgx = Rgx(); + static auto rgx = RgxO(); string[] doc; string segment_filename; string[] top_level_headings = ["","","",""]; @@ -618,7 +618,7 @@ template outputEPub3() { static assert(is(typeof(epub_write.oebps_toc_ncx) == string)); static assert(is(typeof(epub_write.oebps_content_opf) == string)); } - static auto rgx = Rgx(); + static auto rgx = RgxO(); auto pth_epub3 = spinePathsEPUB!()(doc_matters.output_path, doc_matters.src.language); auto xhtml_format = outputXHTMLs(); /+ zip file +/ diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d index 637b007..ee530ca 100644 --- a/src/doc_reform/io_out/html.d +++ b/src/doc_reform/io_out/html.d @@ -17,9 +17,9 @@ template outputHTML() { const D doc_abstraction, M doc_matters, ) { - mixin spineOutputRgxInit; + mixin spineRgxOut; auto xhtml_format = outputXHTMLs(); - static auto rgx = Rgx(); + static auto rgx = RgxO(); string[] doc_html; string[] doc; string suffix = ".html"; @@ -210,8 +210,8 @@ template outputHTML() { const D doc_abstraction, M doc_matters, ) { - mixin spineOutputRgxInit; - static auto rgx = Rgx(); + mixin spineRgxOut; + static auto rgx = RgxO(); auto xhtml_format = outputXHTMLs(); string[][string] doc_html; string[][string] doc_html_endnotes; @@ -467,8 +467,8 @@ template outputHTML() { debug(asserts) { static assert(is(typeof(doc_html) == string[][string])); } - mixin spineOutputRgxInit; - static auto rgx = Rgx(); + mixin spineRgxOut; + static auto rgx = RgxO(); auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); auto xhtml_format = outputXHTMLs(); auto m = doc_matters.src.filename.matchFirst(rgx.src_fn); diff --git a/src/doc_reform/io_out/hub.d b/src/doc_reform/io_out/hub.d index df3d28c..e275348 100644 --- a/src/doc_reform/io_out/hub.d +++ b/src/doc_reform/io_out/hub.d @@ -15,10 +15,10 @@ template outputHub() { const D doc_abstraction, I doc_matters ) { - mixin spineOutputRgxInit; + mixin spineRgxOut; mixin Msg; auto msg = Msg!()(doc_matters); - static auto rgx = Rgx(); + static auto rgx = RgxO(); enum outTask { source_or_pod, sqlite, sqlite_multi, latex, odt, epub, html_scroll, html_seg, html_stuff } void Scheduled(D,I)(int sched, D doc_abstraction, I doc_matters) { auto msg = Msg!()(doc_matters); @@ -118,8 +118,8 @@ template outputHubOp() { doc_reform.io_out.create_zip_file, doc_reform.io_out.paths_output; @system void outputHubOp(E,O)(E env, O opt_action) { - mixin spineOutputRgxInit; - static auto rgx = Rgx(); + mixin spineRgxOut; + static auto rgx = RgxO(); if ((opt_action.sqlite_db_drop)) { if ((opt_action.verbose)) { writeln("sqlite drop db..."); diff --git a/src/doc_reform/io_out/latex.d b/src/doc_reform/io_out/latex.d index b8e33f4..ff5b0df 100644 --- a/src/doc_reform/io_out/latex.d +++ b/src/doc_reform/io_out/latex.d @@ -8,8 +8,8 @@ template outputLaTeX() { std.uri, std.conv : to; mixin InternalMarkup; // watch - mixin spineOutputRgxInit; - static auto rgx = Rgx(); + mixin spineRgxOut; + static auto rgx = RgxO(); mixin spineLanguageCodes; auto lang = Lang(); auto paper() { diff --git a/src/doc_reform/io_out/odt.d b/src/doc_reform/io_out/odt.d index 67b34ba..09ff63d 100644 --- a/src/doc_reform/io_out/odt.d +++ b/src/doc_reform/io_out/odt.d @@ -12,9 +12,9 @@ template formatODT() { doc_reform.io_out.create_zip_file, doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; - mixin spineOutputRgxInit; + mixin spineRgxOut; struct formatODT { - static auto rgx = Rgx(); + static auto rgx = RgxO(); @safe string _tags(O)(const O obj) { string _tags = ""; if (obj.tags.anchor_tags.length > 0) { @@ -56,7 +56,7 @@ template formatODT() { return _on; } @safe string _footnotes()(string _txt) { - static auto rgx = Rgx(); + static auto rgx = RgxO(); _txt = _txt.replaceAll( rgx.inline_notes_al_regular_number_note, format(q"┃ @@ -603,8 +603,8 @@ template outputODT() { doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; mixin InternalMarkup; - mixin spineOutputRgxInit; - static auto rgx = Rgx(); + mixin spineRgxOut; + static auto rgx = RgxO(); // mixin outputXmlODT; @safe string odt_head(I)(I doc_matters) { string _has_tables = format(q"┃ diff --git a/src/doc_reform/io_out/paths_output.d b/src/doc_reform/io_out/paths_output.d index 23c4624..f01f88b 100644 --- a/src/doc_reform/io_out/paths_output.d +++ b/src/doc_reform/io_out/paths_output.d @@ -82,8 +82,8 @@ template spineOutPathsFnPd() { } template spineDocRootTreeHTML() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spineDocRootTreeHTML()(string lng) { auto lng_pth = spineOutPaths!()("", lng); string base_dir = "html"; @@ -142,8 +142,8 @@ template spineDocRootTreeHTML() { } } template spinePathsHTML() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spinePathsHTML()( string output_path_root, string lng, @@ -203,8 +203,8 @@ template spinePathsHTML() { } template spineUrlsHTML() { import std.format; - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spineUrlsHTML()( string url_doc_root, string lng, @@ -304,8 +304,8 @@ template spineUrlsHTML() { } } template spinePathsEPUB() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spinePathsEPUB()( string output_pth_root, string lng, @@ -409,8 +409,8 @@ template spinePathsEPUB() { } } template spinePathsODT() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spinePathsODT(M)( M doc_matters, ) { @@ -473,8 +473,8 @@ template spinePathsODT() { } } template spinePathsLaTeX() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spinePathsLaTeX(M)( M doc_matters, ) { @@ -502,8 +502,8 @@ template spinePathsLaTeX() { } } template spinePathsSQLiteDiscrete() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spinePathsSQLiteDiscrete()( string output_pth_root, string lng, @@ -528,8 +528,8 @@ template spinePathsSQLiteDiscrete() { } } template spinePathsSQLite() { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); auto spinePathsSQLite(DbN, Po)( DbN db_name, Po output_pth_root, diff --git a/src/doc_reform/io_out/rgx.d b/src/doc_reform/io_out/rgx.d index 4d0801c..32d457d 100644 --- a/src/doc_reform/io_out/rgx.d +++ b/src/doc_reform/io_out/rgx.d @@ -2,9 +2,8 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.io_out.rgx; -static template spineOutputRgxInit() { - import doc_reform.io_out.defaults; - static struct Rgx { +static template spineRgxOut() { + static struct RgxO { static newline = ctRegex!("\n", "mg"); static space = ctRegex!(`[ ]`, "mg"); static spaces_keep = ctRegex!(`(?P^[ ]+|[ ]{2,})`, "mg"); // code, verse, block diff --git a/src/doc_reform/io_out/source_pod.d b/src/doc_reform/io_out/source_pod.d index 59746de..5a96ed6 100644 --- a/src/doc_reform/io_out/source_pod.d +++ b/src/doc_reform/io_out/source_pod.d @@ -14,14 +14,14 @@ template spinePod() { debug(asserts) { // static assert(is(typeof(doc_matters) == tuple)); } - mixin spineOutputRgxInit; + mixin spineRgxOut; string pwd = doc_matters.env.pwd; auto src_path_info = doc_matters.src_path_info; auto pth_dr_doc_src = doc_matters.src_path_info; auto pths_pod = spinePathsPods!()(doc_matters); mixin spineLanguageCodes; auto lang = Lang(); - static auto rgx = Rgx(); + static auto rgx = RgxO(); assert (doc_matters.src.filename.match(rgx.src_fn)); @system auto pod_archive(Z)( string _source_type, diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index e83a75f..d24fc00 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -6,9 +6,9 @@ import std.conv : to; import d2sqlite3; import std.typecons : Nullable; -mixin spineOutputRgxInit; +mixin spineRgxOut; mixin InternalMarkup; -static auto rgx = Rgx(); +static auto rgx = RgxO(); static auto mkup = InlineMarkup(); long _metadata_tid_lastrowid; template SQLiteHubBuildTablesAndPopulate() { @@ -138,7 +138,7 @@ template SQLiteFormatAndLoadObject() { auto SQLiteFormatAndLoadObject(M)( M doc_matters, ) { - mixin spineOutputRgxInit; + mixin spineRgxOut; struct sqlite_format_and_load_objects { string generic_munge_sanitize_text_for_search( string _txt, diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index 1b038a9..b640d81 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -12,9 +12,9 @@ template outputXHTMLs() { doc_reform.io_out.create_zip_file, doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; - mixin spineOutputRgxInit; + mixin spineRgxOut; struct outputXHTMLs { - static auto rgx = Rgx(); + static auto rgx = RgxO(); @safe string div_delimit( string part, return ref string previous_part diff --git a/src/doc_reform/meta/conf_make_meta_json.d b/src/doc_reform/meta/conf_make_meta_json.d index 4fc3bc4..a6214ce 100644 --- a/src/doc_reform/meta/conf_make_meta_json.d +++ b/src/doc_reform/meta/conf_make_meta_json.d @@ -21,8 +21,8 @@ static template contentJSONtoSpineStruct() { doc_reform.meta.rgx; ConfComposite _struct_composite; @safe auto contentJSONtoSpineStruct(C,J,M)(C _struct_composite, J _json, M _manifested, string _identifier) { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); debug (json) { writeln(">> --------------------------- >>"); foreach (tag0; _json.object.byKeyValue) { diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d index 683d355..7698388 100644 --- a/src/doc_reform/meta/conf_make_meta_structs.d +++ b/src/doc_reform/meta/conf_make_meta_structs.d @@ -12,8 +12,8 @@ import import doc_reform.meta.defaults, doc_reform.meta.rgx; -mixin spineRgxInit; -static auto rgx = Rgx(); +mixin spineRgxIn; +static auto rgx = RgxI(); mixin InternalMarkup; static auto mkup = InlineMarkup(); @safe string url_markup(string line) { diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index 5355a58..2efd515 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -26,8 +26,8 @@ template contentYAMLtoSpineStruct() { M _manifested, string _identifier ) { - mixin spineRgxInit; - static auto rgx = Rgx(); + mixin spineRgxIn; + static auto rgx = RgxI(); confCompositeMakeBuild _mk; /+ make ------------------------------------------------------------------- +/ if ("make" in _yaml @@ -829,9 +829,9 @@ template docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct() { doc_reform.meta.conf_make_meta_structs, doc_reform.meta.conf_make_meta_json, doc_reform.meta.rgx; - mixin spineRgxInit; + mixin spineRgxIn; mixin contentJSONtoSpineStruct; - static auto rgx = Rgx(); + static auto rgx = RgxI(); @system auto docHeaderMakeAndMetaTupYamlExtractAndConvertToStruct(CCm,Src,M)( Src header_src, CCm _make_and_meta_struct, diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index eff632e..63eb5fa 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -2,7 +2,7 @@ default settings +/ module doc_reform.meta.defaults; -template spineRgxInitFlags() { +template spineRgxDocStructFlags() { /+ regex flags +/ @safe static int[string] flags_type_init() { int[string] flags_type_init = [ diff --git a/src/doc_reform/meta/doc_debugs.d b/src/doc_reform/meta/doc_debugs.d index 2815e4f..9ab9ea7 100644 --- a/src/doc_reform/meta/doc_debugs.d +++ b/src/doc_reform/meta/doc_debugs.d @@ -25,9 +25,9 @@ template spineDebugs() { const S contents, T doc_matters, ) { - mixin spineRgxInit; + mixin spineRgxIn; mixin InternalMarkup; - static auto rgx = Rgx(); + static auto rgx = RgxI(); auto markup = InlineMarkup(); string key; debug(parent) { diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index e18a19e..90fec4a 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -21,15 +21,15 @@ template spineAbstraction() { doc_reform.io_in.read_config_files, doc_reform.io_in.read_source_files, doc_reform.io_out.hub; - mixin spineRgxInit; + mixin spineRgxIn; mixin contentJSONtoSpineStruct; mixin spineBiblio; - mixin spineRgxInitFlags; + mixin spineRgxDocStructFlags; mixin outputHub; enum headBody { header, body_content, insert_file_list, image_list } enum makeMeta { make, meta } enum docAbst { doc_abstract_obj, doc_has } - static auto rgx = Rgx(); + static auto rgx = RgxI(); @system auto spineAbstraction(E,P,O,M,S)( E _env, P program_info, diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 3c58212..3ce25b5 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -20,7 +20,7 @@ template docAbstraction() { /+ ↓ abstraction mixins +/ mixin ObjectSetter; mixin InternalMarkup; - mixin spineRgxInit; + mixin spineRgxIn; /+ ↓ abstraction struct init +/ /+ initialize +/ ObjGenericComposite[] the_table_of_contents_section; @@ -257,7 +257,7 @@ template docAbstraction() { return object_citation_number.ocn_emitter(ocn_status_flag); } @safe static auto inline_markup_faces(L)(L line) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto mkup = InlineMarkup(); line = replaceAll!(m => mkup.quote_o ~ m[1] ~ mkup.quote_c)(line, rgx.within_quotes); line = replaceAll!(m => mkup.mono ~ mkup.ff_o ~ m["text"] ~ mkup.ff_c ~ mkup.mono)(line, rgx.inline_mark_mono); @@ -268,7 +268,7 @@ template docAbstraction() { return line; } @safe static string links_and_images()(string obj_txt) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto mkup = InlineMarkup(); if (obj_txt.match(rgx.smid_inline_url_generic)) { if ( @@ -319,7 +319,7 @@ template docAbstraction() { string[string] tag_in_seg, string[string][string] tag_assoc ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (auto m = an_object["substantive"].match(rgx.inline_link_anchor)) { if (m.captures[1] !in tag_assoc) { tag_assoc[(m.captures[1])]["seg_lv4"] = tag_in_seg["seg_lv4"]; @@ -338,7 +338,7 @@ template docAbstraction() { Mf manifested, bool _new_doc ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); /+ ↓ abstraction init +/ scope(success) { } @@ -355,7 +355,7 @@ template docAbstraction() { previous_length=0; reset_note_numbers=true; } - mixin spineRgxInitFlags; + mixin spineRgxDocStructFlags; mixin spineNode; auto node_para_int_ = node_metadata_para_int; auto node_para_str_ = node_metadata_para_str; @@ -2439,7 +2439,7 @@ template docAbstraction() { char[] line, int[string] obj_type_status, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (!(line.empty) && (obj_type_status["ocn_status_off_for_multiple_objects"] == OCN_off_block_status.off) ) { @@ -2540,7 +2540,7 @@ template docAbstraction() { return ref uint[string] dochas, return ref string[string] object_number_poem ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (auto m = line.matchFirst(rgx.block_curly_code_open)) { dochas["codeblock"]++; an_object["lang"] = ""; @@ -2725,7 +2725,7 @@ template docAbstraction() { string[string] an_object, return ref int[string] obj_type_status ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (obj_type_status["curly_quote"] == TriState.on) { if (line.matchFirst(rgx.block_curly_quote_close)) { debug(quote) { // quote (curly) close @@ -2764,7 +2764,7 @@ template docAbstraction() { string[string] an_object, return ref int[string] obj_type_status ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (obj_type_status["curly_group"] == State.on) { if (line.matchFirst(rgx.block_curly_group_close)) { debug(group) { @@ -2803,7 +2803,7 @@ template docAbstraction() { string[string] an_object, return ref int[string] obj_type_status ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (obj_type_status["curly_block"] == TriState.on) { if (line.matchFirst(rgx.block_curly_block_close)) { debug(block) { // block (curly) close @@ -2846,7 +2846,7 @@ template docAbstraction() { CMM conf_make_meta, string[string] tag_in_seg, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (obj_type_status["curly_poem"] == TriState.on) { if (line.matchFirst(rgx.block_curly_poem_close)) { if (an_object_key in an_object @@ -3084,7 +3084,7 @@ template docAbstraction() { return ref string[string] an_object, return ref int[string] obj_type_status ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (obj_type_status["curly_code"] == TriState.on) { if (line.matchFirst(rgx.block_curly_code_close)) { debug(codecurly) { // code (curly) close @@ -3127,7 +3127,7 @@ template docAbstraction() { return ref int[string] obj_type_status, return ref CMM conf_make_meta, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (obj_type_status["curly_table"] == TriState.on) { if (line.matchFirst(rgx.block_curly_table_close)) { debug(table) { // table (curly) close @@ -3207,7 +3207,7 @@ template docAbstraction() { ) { mixin spineBiblio; auto jsn = BibJsnStr(); - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (line.matchFirst(rgx.heading_biblio) && obj_type_status["para"] != State.on && obj_type_status["group"] != State.on @@ -3392,7 +3392,7 @@ template docAbstraction() { "code block status: closed" ); assertions_flag_types_block_status_none_or_closed(obj_type_status); - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (obj_type_status["quote"] == TriState.closing) { obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]); an_object["bookindex_nugget"] @@ -3685,7 +3685,7 @@ template docAbstraction() { return ref int[string] obj_type_status, B opt_action, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (auto m = line.match(rgx.book_index)) { /+ match book_index +/ debug(bookindexmatch) { writefln( @@ -3735,7 +3735,7 @@ template docAbstraction() { return ref Regex!(char)[string] heading_match_rgx, return ref int[string] obj_type_status ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if ((_make_unmarked_headings.length > 2) && (obj_type_status["make_headings"] == State.off)) { /+ headings found +/ debug(headingsfound) { @@ -3875,7 +3875,7 @@ template docAbstraction() { return ref int[string] obj_type_status, return ref CMM conf_make_meta, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (auto m = line.match(rgx.heading)) { /+ heading match +/ ++line_occur["heading"]; obj_type_status["heading"] = State.on; @@ -4027,7 +4027,7 @@ template docAbstraction() { return ref int[string] obj_type_status, return ref int[string] line_occur, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (line_occur["para"] == State.off) { line = font_faces_line(line); /+ para matches +/ @@ -4074,7 +4074,7 @@ template docAbstraction() { @safe char[] font_faces_line()( char[] textline, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto mkup = InlineMarkup(); if (textline.match(rgx.inline_faces_line)) { textline = textline @@ -4097,7 +4097,7 @@ template docAbstraction() { return ref ObjGenericComposite table_object, H table_head, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); table_object.metainfo.is_of_part = "body"; table_object.metainfo.is_of_section = "body"; table_object.metainfo.is_of_type = "block"; @@ -4122,7 +4122,7 @@ template docAbstraction() { return ref ObjGenericComposite table_object, return ref T table_array, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto mng = InlineMarkup(); string _table_substantive; ulong col_num; @@ -4246,7 +4246,7 @@ template docAbstraction() { return ref ObjGenericComposite table_object, return ref T table_substantive, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto munge = ObjInlineMarkupMunge(); string[] _table_rows = (table_substantive).split(rgx.table_row_delimiter); string[] _table_cols; @@ -4262,7 +4262,7 @@ template docAbstraction() { return ref ObjGenericComposite table_object, return ref T table_substantive, ) { - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto munge = ObjInlineMarkupMunge(); string[] _table_rows = (table_substantive).split(rgx.table_row_delimiter_special); string[] _table_cols; @@ -4330,7 +4330,7 @@ template docAbstraction() { int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; string asterisks_, plus_; string obj_txt_out, tail, note; - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto mkup = InlineMarkup(); int stage_reset_note_numbers = true; private auto initialize_note_numbers() { @@ -4576,7 +4576,7 @@ template docAbstraction() { } } static struct ObjInlineMarkup { - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto munge = ObjInlineMarkupMunge(); string[string] obj_txt; static string anchor_tag = ""; @@ -5162,7 +5162,7 @@ template docAbstraction() { ); } } - static auto rgx = Rgx(); + static auto rgx = RgxI(); if (!bookindex_section.empty) { auto bi_main_terms_split_arr = bookindex_section.split(rgx.bi_main_terms_split); @@ -5240,7 +5240,7 @@ template docAbstraction() { } struct BookIndexReportSection { int mkn, skn; - static auto rgx = Rgx(); + static auto rgx = RgxI(); static auto munge = ObjInlineMarkupMunge(); @safe void bookindex_write_section()( string[][string][string] bookindex_unordered_hashes @@ -5434,7 +5434,7 @@ template docAbstraction() { string[string] object_notes; int previous_count; int mkn; - static auto rgx = Rgx(); + static auto rgx = RgxI(); @safe private auto gather_notes_for_endnote_section( ObjGenericComposite[] contents_am, string[string] tag_in_seg, @@ -5722,7 +5722,7 @@ template docAbstraction() { int lv, lv0, lv1, lv2, lv3, lv4, lv5, lv6, lv7; int obj_cite_digit; int[string] p_; // p_ parent_ - static auto rgx = Rgx(); + static auto rgx = RgxI(); @safe ObjGenericComposite node_location_emitter(La,Ta,N)( string lev_markup_number, string[string] tag_in_seg, diff --git a/src/doc_reform/meta/metadoc_harvests_authors.d b/src/doc_reform/meta/metadoc_harvests_authors.d index 3a7aebc..132c0af 100644 --- a/src/doc_reform/meta/metadoc_harvests_authors.d +++ b/src/doc_reform/meta/metadoc_harvests_authors.d @@ -12,7 +12,6 @@ module doc_reform.meta.metadoc_harvests_authors; doc_reform.meta.rgx; mixin spineHarvest; mixin InternalMarkup; - mixin spineRgxInit; template spineMetaDocHarvestsAuthors() { static auto mkup = InlineMarkup(); void spineMetaDocHarvestsAuthors(H,M,O)( diff --git a/src/doc_reform/meta/metadoc_harvests_topics.d b/src/doc_reform/meta/metadoc_harvests_topics.d index 8c41f3b..aeb7cba 100644 --- a/src/doc_reform/meta/metadoc_harvests_topics.d +++ b/src/doc_reform/meta/metadoc_harvests_topics.d @@ -12,7 +12,6 @@ module doc_reform.meta.metadoc_harvests_topics; doc_reform.meta.rgx; mixin spineHarvest; mixin InternalMarkup; - mixin spineRgxInit; template spineMetaDocHarvestsTopics() { static auto mkup = InlineMarkup(); void spineMetaDocHarvestsTopics(H,M,O)( diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d index c7a110b..94ef091 100644 --- a/src/doc_reform/meta/rgx.d +++ b/src/doc_reform/meta/rgx.d @@ -2,8 +2,8 @@ regex: regular expressions used in sisu document parser +/ module doc_reform.meta.rgx; -static template spineRgxInit() { - static struct Rgx { +static template spineRgxIn() { + static struct RgxI { /+ misc +/ // static true_dollar = ctRegex!(`\$`, "gm"); static sep = ctRegex!(`␣`, "gm"); diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index b7d9731..67ee838 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -87,16 +87,16 @@ description "A SiSU inspired document parser writen in D." homepage "http://sisudoc.org" +/ @system void main(string[] args) { - mixin spineRgxInit; + mixin spineRgxIn; mixin contentJSONtoSpineStruct; mixin spineBiblio; - mixin spineRgxInitFlags; + mixin spineRgxDocStructFlags; mixin outputHub; auto hvst = spineHarvest!(); string flag_action; string arg_unrecognized; enum dAM { abstraction, matters } - static auto rgx = Rgx(); + static auto rgx = RgxI(); scope(success) { writefln( "~ run complete, ok ~ (%s-%s.%s.%s, %s D:%s, %s %s)", -- cgit v1.2.3