diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-12-05 11:41:09 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2020-01-13 16:06:43 -0500 |
commit | 9a91485c10e059dee1374e152e4b068cd9d3866c (patch) | |
tree | 4eaa00d4e7e8fb5d576142d364657d5b67d3b766 /src/doc_reform/io_in/read_source_files.d | |
parent | yaml config, provide default if not read (diff) |
0.9.2 @safe & @trusted first pass
Diffstat (limited to 'src/doc_reform/io_in/read_source_files.d')
-rw-r--r-- | src/doc_reform/io_in/read_source_files.d | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/doc_reform/io_in/read_source_files.d b/src/doc_reform/io_in/read_source_files.d index e443b01..aeb2382 100644 --- a/src/doc_reform/io_in/read_source_files.d +++ b/src/doc_reform/io_in/read_source_files.d @@ -15,7 +15,7 @@ static template spineRawMarkupContent() { mixin spineRgxInit; static auto rgx = Rgx(); string[] _images=[]; - auto _extract_images(S)(S content_block) { + auto _extract_images(S)(S content_block) @safe { string[] images_; string _content_block = content_block.to!string; if (auto m = _content_block.matchAll(rgx.image)) { @@ -24,7 +24,7 @@ static template spineRawMarkupContent() { return images_; } auto rawsrc = RawMarkupContent(); - auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) { + auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) @safe { auto _0_header_1_body_content_2_insert_filelist_tuple = rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src); return _0_header_1_body_content_2_insert_filelist_tuple; @@ -36,7 +36,11 @@ static template spineRawMarkupContent() { = raw.markupSourceReadIn(fn_src); return source_txt_str; } - final auto sourceContentSplitIntoHeaderAndBody(O)(O _opt_action, in string source_txt_str, in string fn_src="") { + final auto sourceContentSplitIntoHeaderAndBody(O)( + O _opt_action, + in string source_txt_str, + in string fn_src="" + ) { auto raw = MarkupRawUnit(); string[] insert_file_list; string[] images_list; @@ -99,7 +103,7 @@ static template spineRawMarkupContent() { std.utf.validate(source_txt_str); return source_txt_str; } - final private char[][] header0Content1(in string src_text) { + final private char[][] header0Content1(in string src_text) @trusted { // cast(char[]) /+ split string on _first_ match of "^:?A~\s" into [header, content] array/tuple +/ char[][] header_and_content; auto m = (cast(char[]) src_text).matchFirst(rgx.heading_a); @@ -112,7 +116,7 @@ static template spineRawMarkupContent() { ); return header_and_content; } - final private char[][] markupSourceLineArray(in char[] src_text) { + final private char[][] markupSourceLineArray(in char[] src_text) @trusted { // cast(char[]) char[][] source_line_arr = (cast(char[]) src_text).split(rgx.newline_eol_strip_preceding); return source_line_arr; @@ -127,7 +131,7 @@ static template spineRawMarkupContent() { auto source_txt_str = readInMarkupSource(fn_src); return source_txt_str; } - auto markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { + auto markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) @safe { string[] file_insert_list = []; string[] images_list = []; char[][] hc = header0Content1(source_txt_str); |