diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2024-03-12 22:39:09 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2024-03-12 22:56:34 -0400 |
commit | e9e17be24eba558c30fcdc41ea5bb9a1da7fd4e7 (patch) | |
tree | 1ed3c4b528b0a8e54d0eb9babc391e562578c7b4 /org/in_source_files.org | |
parent | nix flake & env upkeep (diff) |
mark modules as @safe: (& identify what is not)
Diffstat (limited to 'org/in_source_files.org')
-rw-r--r-- | org/in_source_files.org | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/org/in_source_files.org b/org/in_source_files.org index 267bdbc..2e21928 100644 --- a/org/in_source_files.org +++ b/org/in_source_files.org @@ -30,6 +30,7 @@ meta_config_files.d +/ module doc_reform.io_in.read_config_files; +@safe: import std.file, std.path; @@ -38,7 +39,6 @@ import doc_reform.io_in.paths_source, doc_reform.meta.rgx_files, doc_reform.meta.rgx; -<<meta_config_file_in>> <<meta_config_file_hub_read_site_config>> <<meta_config_file_hub_read_document_config>> <<meta_config_file_hub_read_site_yaml>> @@ -224,13 +224,13 @@ static template readConfigDoc() { if (config_file_str.length > 0) { break; } } struct _ConfContent { - @safe string filename() { + string filename() { return conf_filename; } - @safe string content() { + string content() { return config_file_str; } - @safe string filetype() { + string filetype() { string _ft = ""; if (content.match(rgx.yaml_config)) { _ft = "yaml"; @@ -257,7 +257,7 @@ static template configReadSiteYAML() { doc_reform.io_in.paths_source, doc_reform.meta.rgx_files, doc_reform.meta.rgx; - @safe final YAMLDocument configReadSiteYAML(M,E)(M _manifested, E _env) { + final YAMLDocument configReadSiteYAML(M,E)(M _manifested, E _env) { string _configuration = configReadInSiteYAML!()(_manifested, _env); auto _conf_file_details = configFilePaths!()(_manifested, _env); string _conf_yaml_fn = _conf_file_details.config_filename_site; @@ -272,7 +272,7 @@ static template configReadDocYAML() { import doc_reform.meta, doc_reform.io_in.paths_source; - @safe final YAMLDocument configReadDocYAML(M,E)(M _manifested, E _env) { + final YAMLDocument configReadDocYAML(M,E)(M _manifested, E _env) { string _configuration = configReadInDocYAML!()(_manifested, _env); auto _conf_file_details = configFilePaths!()(_manifested, _env); string _conf_yaml_fn = _conf_file_details.config_filename_document; @@ -295,6 +295,7 @@ static template configReadDocYAML() { - if master file scan for addional files to import/insert +/ module doc_reform.io_in.read_source_files; +@safe: template spineRawMarkupContent() { import std.file, @@ -309,7 +310,7 @@ template spineRawMarkupContent() { mixin spineRgxFiles; static auto rgx_files = RgxFiles(); string[] _images=[]; - @safe string[] _extract_images(S)(S content_block) { + string[] _extract_images(S)(S content_block) { string[] images_; string _content_block = content_block.to!string; if (auto m = _content_block.matchAll(rgx.image)) { @@ -329,19 +330,19 @@ template spineRawMarkupContent() { string[], "insert_files", string[], "images" ); - @safe auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) { + auto spineRawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) { 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; } struct RawMarkupContent { - @safe final sourceContent(in string fn_src) { + final sourceContent(in string fn_src) { auto raw = MarkupRawUnit(); string source_txt_str = raw.markupSourceReadIn(fn_src); return source_txt_str; } - @safe final auto sourceContentSplitIntoHeaderAndBody(O)( + final auto sourceContentSplitIntoHeaderAndBody(O)( O _opt_action, in string source_txt_str, in string fn_src="" @@ -390,7 +391,7 @@ template spineRawMarkupContent() { char[][], "insert_contents", string[], "images" ); - @safe ContentsAndImages scan_subdoc_source(O)( + ContentsAndImages scan_subdoc_source(O)( O _opt_action, char[][] markup_sourcefile_insert_content, string fn_src @@ -401,7 +402,7 @@ template spineRawMarkupContent() { } // end src subdoc (inserts) loop <<meta_inserts_scan_post>> } - @safe ContentsInsertsImages scan_master_src_for_insert_files_and_import_content(O)( + ContentsInsertsImages scan_master_src_for_insert_files_and_import_content(O)( O _opt_action, char[][] sourcefile_body_content, string fn_src @@ -422,7 +423,7 @@ template spineRawMarkupContent() { #+NAME: meta_markup_source_raw_read_file_source_string #+BEGIN_SRC d -@safe final private string readInMarkupSource(in char[] fn_src) { +final private string readInMarkupSource(in char[] fn_src) { enforce( exists(fn_src) != 0, "file not found: «" ~ @@ -488,7 +489,7 @@ split is on first match of level A~ (which is required) #+NAME: meta_markup_source_raw_read_in_file #+BEGIN_SRC d -@safe string markupSourceReadIn(in string fn_src) { +string markupSourceReadIn(in string fn_src) { static auto rgx_files = RgxFiles(); enforce( fn_src.match(rgx_files.src_pth_sst_or_ssm), @@ -509,7 +510,7 @@ split is on first match of level A~ (which is required) #+NAME: meta_markup_source_raw_tuple_of_header_and_body #+BEGIN_SRC d -@safe HeaderContentInsertsImages markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { +HeaderContentInsertsImages markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { string[] file_insert_list = []; string[] images_list = []; char[][] hc = header0Content1(source_txt_str); @@ -530,7 +531,7 @@ split is on first match of level A~ (which is required) #+NAME: meta_markup_source_raw_get_insert_source_line_array #+BEGIN_SRC d -@safe final char[][] getInsertMarkupSourceContentRawLineArray( +final char[][] getInsertMarkupSourceContentRawLineArray( in char[] fn_src_insert, Regex!(char) rgx_file ) { |