diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2020-01-05 20:17:17 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2020-02-11 13:08:49 -0500 |
commit | de02319cfa7b4bbff8c111bda02be1a7c6591555 (patch) | |
tree | 732c11d10bc2699cd1b72d00b3be943284eea130 /src/doc_reform/meta/defaults.d | |
parent | reduce use of auto, much with tuples (diff) |
dlang safe default imminent, look ahead
- @safe @trusted & @system, reconsider @trusted
Diffstat (limited to 'src/doc_reform/meta/defaults.d')
-rw-r--r-- | src/doc_reform/meta/defaults.d | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index 0b6388b..eff632e 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -4,7 +4,7 @@ module doc_reform.meta.defaults; template spineRgxInitFlags() { /+ regex flags +/ - static int[string] flags_type_init() { + @safe static int[string] flags_type_init() { int[string] flags_type_init = [ "make_headings" : 0, "header_make" : 0, @@ -45,7 +45,7 @@ template spineRgxInitFlags() { } } template spineNode() { - static string[string] node_metadata_heading_str() { + @safe static string[string] node_metadata_heading_str() { string[string] _node = [ "is" : "", "ocn" : "", @@ -56,7 +56,7 @@ template spineNode() { ]; return _node; } - static int[string] node_metadata_heading_int() { + @safe static int[string] node_metadata_heading_int() { int[string] _node = [ "ocn" : 0, // decide whether to use or keep? "ptr_doc_object" : 0, @@ -69,7 +69,7 @@ template spineNode() { ]; return _node; } - static string[string] node_metadata_para_str() { + @safe static string[string] node_metadata_para_str() { string[string] _node = [ "is" : "", "ocn" : "", @@ -77,7 +77,7 @@ template spineNode() { ]; return _node; } - static int[string] node_metadata_para_int() { + @safe static int[string] node_metadata_para_int() { int[string] _node = [ "ocn" : 0, "indent_base" : 0, @@ -88,7 +88,7 @@ template spineNode() { } } template spineHarvest() { - auto spineHarvest() { + @safe auto spineHarvest() { struct _Harvest { struct Harvest { string title = ""; @@ -122,7 +122,7 @@ template spineHarvest() { template spineBiblio() { // required: deemed_author (author || editor); year; fulltitle; struct BibJsnStr { - static auto biblio_entry_tags_jsonstr() { + @safe static auto biblio_entry_tags_jsonstr() { string x = `{ "is" : "", "sortby_deemed_author_year_title" : "", @@ -203,7 +203,7 @@ template InternalMarkup() { template spineLanguageCodes() { /+ language codes +/ struct Lang { - static string[string][string] codes() { + @safe static string[string][string] codes() { auto _lang_codes = [ "am": [ "c": "am", "n": "Amharic", "t": "Amharic", "xlp": "amharic" ], "bg": [ "c": "bg", "n": "Bulgarian", "t": "Български (Bəlgarski)", "xlp": "bulgarian" ], @@ -270,15 +270,15 @@ template spineLanguageCodes() { ]; return _lang_codes; } - static string[] code_arr_ptr() { + @safe static string[] code_arr_ptr() { string[] _lang_codes = ["am", "bg", "bn", "br", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hy", "ia", "is", "it", "ja", "ko", "la", "lo", "lt", "lv", "ml", "mr", "nl", "no", "nn", "oc", "pl", "pt", "pt_BR", "ro", "ru", "sa", "se", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "tr", "uk", "ur", "us", "vi", "zh", "en", "xx",]; return _lang_codes; } - static string[] code_arr() { + @safe static string[] code_arr() { string[] _lang_codes = ["am", "bg", "bn", "br", "ca", "cs", "cy", "da", "de", "el", "en", "eo", "es", "et", "eu", "fi", "fr", "ga", "gl", "he", "hi", "hr", "hy", "ia", "is", "it", "ja", "ko", "la", "lo", "lt", "lv", "ml", "mr", "nl", "no", "nn", "oc", "pl", "pt", "pt_BR", "ro", "ru", "sa", "se", "sk", "sl", "sq", "sr", "sv", "ta", "te", "th", "tk", "tr", "uk", "ur", "vi", "zh"]; return _lang_codes; } - static auto codes_() { + @safe static auto codes_() { return "(" ~ join(code_arr,"|") ~ ")"; } static auto codes_regex() { |