diff options
author | Ralph Amissah <ralph@amissah.com> | 2016-04-24 22:35:39 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2016-04-24 22:35:39 -0400 |
commit | 9c14b019a6f695b54a035605e3bb3fc76bf20aa6 (patch) | |
tree | 517169ec313d81aca54da3ddcb1f329b7caba695 /lib/sdp/ao_scan_inserts.d | |
parent | step1 (diff) |
step2doc-reform_v0.0.2
Diffstat (limited to 'lib/sdp/ao_scan_inserts.d')
-rw-r--r-- | lib/sdp/ao_scan_inserts.d | 199 |
1 files changed, 0 insertions, 199 deletions
diff --git a/lib/sdp/ao_scan_inserts.d b/lib/sdp/ao_scan_inserts.d deleted file mode 100644 index f70b2e7..0000000 --- a/lib/sdp/ao_scan_inserts.d +++ /dev/null @@ -1,199 +0,0 @@ -/+ - inserts - ao_inserts.d -+/ -mixin template SiSUdocInserts() { - private: - struct Inserts { - auto scan_subdoc_source( - char[][] markup_sourcefile_insert_content, - string fn_src - ) { - char[][] contents_insert; - auto ft1 = flag_type.dup; - mixin ScreenTxtColors; - auto rgx = Rgx(); - int tell_l(string color, in char[] line) { - writeln(scr_txt_marker[color], line); - return 0; - } - auto fn_pth_full = match(fn_src, rgx.src_pth); - auto markup_src_file_path = fn_pth_full.captures[1]; - foreach (line; markup_sourcefile_insert_content) { - if (ft1["curly_code"] == 1) { - ft1["header_make"] = 0; - ft1["header_metadata"] = 0; - if (auto m = match(line, rgx.block_curly_code_close)) { - ft1["curly_code"] = 0; - } - contents_insert ~= line; - } else if (auto m = match(line, rgx.block_curly_code_open)) { - ft1["curly_code"] = 1; - ft1["header_make"] = 0; - ft1["header_metadata"] = 0; - contents_insert ~= line; - } else if (ft1["tic_code"] == 1) { - ft1["header_make"] = 0; - ft1["header_metadata"] = 0; - if (auto m = match(line, rgx.block_tic_close)) { - ft1["tic_code"] = 0; - } - contents_insert ~= line; - } else if (auto m = match(line, rgx.block_tic_code_open)) { - ft1["tic_code"] = 1; - ft1["header_make"] = 0; - ft1["header_metadata"] = 0; - contents_insert ~= line; - } else if ( - (ft1["header_make"] == 1) - && match(line, rgx.header_sub) - ) { - ft1["header_make"] = 1; - ft1["header_metadata"] = 0; - } else if ( - (ft1["header_metadata"] == 1) - && match(line, rgx.header_sub) - ) { - ft1["header_metadata"] = 1; - ft1["header_make"] = 0; - } else if (auto m = match(line, rgx.insert_src_fn_ssi_or_sst)) { - ft1["header_make"] = 0; - ft1["header_metadata"] = 0; - auto insert_fn = m.captures[2]; - auto insert_sub_pth = m.captures[1]; - auto fn_src_insert = - (markup_src_file_path ~ insert_sub_pth ~ insert_fn); - auto raw = MarkupRaw(); - auto markup_sourcesubfile_insert_content = - raw.markupInsertSourceContentRawLineArray(fn_src_insert); - debug(insert) { // insert file - tell_l("red", line); - tell_l("red", fn_src_insert); - tell_l("fuchsia", "ERROR"); - writeln( - " length contents insert array: ", - markup_sourcesubfile_insert_content.length - ); - } - auto ins = Inserts(); - /+ - 1. load file, - 2. read lines; - 3. scan lines, - 4. if filename insert, and insert filename - 5. repeat 1 - 6. else - 7. add line to new array; - +/ - } else { - ft1["header_make"] = 0; - ft1["header_metadata"] = 0; - contents_insert ~= line; - } - } // end src subdoc (inserts) loop - return contents_insert; - } - auto scan_doc_source( - char[][] markup_sourcefile_content, - string fn_src - ) { - char[][] contents; - auto ft = flag_type.dup; - mixin ScreenTxtColors; - auto rgx = Rgx(); - int tell_l(string color, in char[] line) { - writeln(scr_txt_marker[color], line); - return 0; - } - auto fn_pth_full = match(fn_src, rgx.src_pth); - auto markup_src_file_path = fn_pth_full.captures[1]; - foreach (line; markup_sourcefile_content) { - if (ft["curly_code"] == 1) { - ft["header_make"] = 0; - ft["header_metadata"] = 0; - if (auto m = match(line, rgx.block_curly_code_close)) { - ft["curly_code"] = 0; - } - contents ~= line; - } else if (auto m = match(line, rgx.block_curly_code_open)) { - ft["curly_code"] = 1; - ft["header_make"] = 0; - ft["header_metadata"] = 0; - contents ~= line; - } else if (ft["tic_code"] == 1) { - ft["header_make"] = 0; - ft["header_metadata"] = 0; - if (auto m = match(line, rgx.block_tic_close)) { - ft["tic_code"] = 0; - } - contents ~= line; - } else if (auto m = match(line, rgx.block_tic_code_open)) { - ft["tic_code"] = 1; - ft["header_make"] = 0; - ft["header_metadata"] = 0; - contents ~= line; - } else if ( - (ft["header_make"] == 1) - && match(line, rgx.header_sub) - ) { - contents ~= line; - } else if ( - (ft["header_metadata"] == 1) - && match(line, rgx.header_sub) - ) { - contents ~= line; - } else if (auto m = match(line, rgx.header_make)) { - ft["header_make"] = 1; - ft["header_metadata"] = 0; - contents ~= line; - } else if (auto m = match(line, rgx.header_metadata)) { - ft["header_make"] = 0; - ft["header_metadata"] = 1; - contents ~= line; - } else if (auto m = match(line, rgx.insert_src_fn_ssi_or_sst)) { - ft["header_make"] = 0; - ft["header_metadata"] = 0; - auto insert_fn = m.captures[2]; - auto insert_sub_pth = m.captures[1]; - auto fn_src_insert = - (markup_src_file_path ~ insert_sub_pth ~ insert_fn); - auto raw = MarkupRaw(); - auto markup_sourcefile_insert_content = - raw.markupInsertSourceContentRawLineArray(fn_src_insert); - debug(insert) { // insert file - tell_l("red", line); - tell_l("red", fn_src_insert); - writeln( - " length contents insert array: ", - markup_sourcefile_insert_content.length - ); - } - auto ins = Inserts(); - auto contents_insert = ins.scan_subdoc_source( - markup_sourcefile_insert_content, - to!string(fn_src_insert) - ); - contents ~= contents_insert; - /+ - 1. load file, - 2. read lines; - 3. scan lines, - 4. if filename insert, and insert filename - 5. repeat 1 - 6. else - 7. add line to new array; - +/ - } else { - ft["header_make"] = 0; - ft["header_metadata"] = 0; - contents ~= line; - } - } // end src doc loop - debug(insert) { // insert file - writeln(__LINE__); - writeln(contents.length); - } - return contents; - } - } -} |