From de02319cfa7b4bbff8c111bda02be1a7c6591555 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 5 Jan 2020 20:17:17 -0500 Subject: dlang safe default imminent, look ahead - @safe @trusted & @system, reconsider @trusted --- org/default_misc.org | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'org/default_misc.org') diff --git a/org/default_misc.org b/org/default_misc.org index 5351c30..d5fd76d 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -40,7 +40,7 @@ module doc_reform.meta.defaults; #+BEGIN_SRC d 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, @@ -87,7 +87,7 @@ template spineRgxInitFlags() { #+name: meta_defaults_template_node #+BEGIN_SRC d template spineNode() { - static string[string] node_metadata_heading_str() { + @safe static string[string] node_metadata_heading_str() { string[string] _node = [ "is" : "", "ocn" : "", @@ -98,7 +98,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, @@ -111,7 +111,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" : "", @@ -119,7 +119,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, @@ -136,7 +136,7 @@ template spineNode() { #+name: meta_defaults_template_harvest #+BEGIN_SRC d template spineHarvest() { - auto spineHarvest() { + @safe auto spineHarvest() { struct _Harvest { struct Harvest { string title = ""; @@ -176,7 +176,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" : "", @@ -313,7 +313,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" ], @@ -380,15 +380,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() { -- cgit v1.2.3