From d56624bce222d870298d937e634fe01aef5c39e4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 27 Jul 2017 04:38:26 -0400 Subject: static, liberal use of keyword --- src/sdp/meta/defaults.d | 54 ++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src/sdp/meta/defaults.d') diff --git a/src/sdp/meta/defaults.d b/src/sdp/meta/defaults.d index fb95e3a..ecc558b 100644 --- a/src/sdp/meta/defaults.d +++ b/src/sdp/meta/defaults.d @@ -22,7 +22,7 @@ template SiSUregisters() { std.uni, std.utf, std.conv : to; - string[string][string] conf_aa_empty() { + static string[string][string] conf_aa_empty() { auto conf_ = [ "webserv": [ "url_root" : "", @@ -97,7 +97,7 @@ template SiSUregisters() { ]; return conf_; } - string[string][string] meta_aa_empty() { + static string[string][string] meta_aa_empty() { auto meta_ = [ "classify": [ "dewey" : "", @@ -159,7 +159,7 @@ template SiSUregisters() { ]; return meta_; } - auto ptr_head_main = + static auto ptr_head_main = [ "classify", "creator", @@ -172,7 +172,7 @@ template SiSUregisters() { "rights", "title" ]; - auto ptr_head_sub_classify = + static auto ptr_head_sub_classify = [ "dewey", "keywords", @@ -180,7 +180,7 @@ template SiSUregisters() { "subject", "topic_register" ]; - auto ptr_head_sub_creator = + static auto ptr_head_sub_creator = [ "author", "author_email", @@ -188,7 +188,7 @@ template SiSUregisters() { "illustrator", "translator" ]; - auto ptr_head_sub_date = + static auto ptr_head_sub_date = [ "added_to_site", "available", @@ -198,14 +198,14 @@ template SiSUregisters() { "published", "valid" ]; - auto ptr_head_sub_identifier = + static auto ptr_head_sub_identifier = [ "isbn", "oclc", "pg" ]; /+ make +/ - auto ptr_head_sub_make = + static auto ptr_head_sub_make = [ "cover_image", "home_button_image", @@ -220,27 +220,27 @@ template SiSUregisters() { "texpdf_font", "css" ]; - auto ptr_head_sub_notes = + static auto ptr_head_sub_notes = [ "abstract", "description" ]; - auto ptr_head_sub_original = + static auto ptr_head_sub_original = [ "language", "source", "title" ]; - auto ptr_head_sub_publisher = + static auto ptr_head_sub_publisher = [ "name" ]; - auto ptr_head_sub_rights = + static auto ptr_head_sub_rights = [ "copyright", "cover", "illustrations", "license" ]; - auto ptr_head_sub_title = + static auto ptr_head_sub_title = [ "edition", "full", @@ -254,7 +254,7 @@ template SiSUregisters() { } template SiSUrgxInitFlags() { /+ regex flags +/ - int[string] flags_type_init() { + static int[string] flags_type_init() { int[string] flags_type_init = [ "make_headings" : 0, "header_make" : 0, @@ -293,7 +293,7 @@ template SiSUrgxInitFlags() { } } template SiSUnode() { - string[string] node_metadata_heading_str() { + static string[string] node_metadata_heading_str() { auto _node = [ "is" : "", "ocn" : "", @@ -303,7 +303,7 @@ template SiSUnode() { ]; return _node; } - int[string] node_metadata_heading_int() { + static int[string] node_metadata_heading_int() { auto _node = [ "ocn" : 0, // decide whether to use or keep? "ptr_doc_object" : 0, @@ -316,7 +316,7 @@ template SiSUnode() { ]; return _node; } - string[string] node_metadata_para_str() { + static string[string] node_metadata_para_str() { auto _node = [ "is" : "", "ocn" : "", @@ -324,7 +324,7 @@ template SiSUnode() { ]; return _node; } - int[string] node_metadata_para_int() { + static int[string] node_metadata_para_int() { auto _node = [ "ocn" : 0, "indent_base" : 0, @@ -337,7 +337,7 @@ template SiSUnode() { template SiSUbiblio() { // required: deemed_author (author || editor); year; fulltitle; struct BibJsnStr { - auto biblio_entry_tags_jsonstr() { + static auto biblio_entry_tags_jsonstr() { string x = `{ "is" : "", "sortby_deemed_author_year_title" : "", @@ -372,7 +372,7 @@ template SiSUbiblio() { } } template InternalMarkup() { - struct InlineMarkup { + static struct InlineMarkup { auto en_a_o = "【"; auto en_a_c = "】"; auto en_b_o = "〖"; auto en_b_c = "〗"; auto lnk_o = "┥"; auto lnk_c = "┝"; @@ -391,11 +391,11 @@ template InternalMarkup() { auto tc_c = "┚"; auto tc_p = "┆"; auto mono = "■"; - string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { + static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); return _indent_spaces; } - string repeat_character_by_number_provided(C,N)(C _character ="-", N number=10) { + static string repeat_character_by_number_provided(C,N)(C _character ="-", N number=10) { _character = replicate(_character, number); return _character; } @@ -404,7 +404,7 @@ template InternalMarkup() { template SiSUlanguageCodes() { /+ language codes +/ struct Lang { - string[string][string] codes() { + 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" ], @@ -471,18 +471,18 @@ template SiSUlanguageCodes() { ]; return _lang_codes; } - string[] code_arr_ptr() { + static string[] code_arr_ptr() { auto _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; } - string[] code_arr() { + static string[] code_arr() { auto _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; } - auto codes_() { + static auto codes_() { return "(" ~ join(code_arr,"|") ~ ")"; } - auto codes_regex() { + static auto codes_regex() { return regex(codes_); } } -- cgit v1.2.3