aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-07-27 04:38:26 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitd56624bce222d870298d937e634fe01aef5c39e4 (patch)
treefda4da44a0fdddda9e99202ad69ebce9193c55ba /src/sdp/output
parentmeta_abstraction, mark some functions pure (diff)
static, liberal use of keyword
Diffstat (limited to 'src/sdp/output')
-rw-r--r--src/sdp/output/defaults.d16
-rw-r--r--src/sdp/output/hub.d4
-rw-r--r--src/sdp/output/paths_output.d10
-rw-r--r--src/sdp/output/paths_source.d2
-rw-r--r--src/sdp/output/rgx.d4
-rw-r--r--src/sdp/output/source_sisupod.d2
-rw-r--r--src/sdp/output/xmls.d2
7 files changed, 20 insertions, 20 deletions
diff --git a/src/sdp/output/defaults.d b/src/sdp/output/defaults.d
index d63c3d5..a15d438 100644
--- a/src/sdp/output/defaults.d
+++ b/src/sdp/output/defaults.d
@@ -4,7 +4,7 @@
module sdp.output.defaults;
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 = "┝";
@@ -23,11 +23,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;
}
@@ -36,7 +36,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" ],
@@ -103,18 +103,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_);
}
}
diff --git a/src/sdp/output/hub.d b/src/sdp/output/hub.d
index b2ae4a6..b7f274a 100644
--- a/src/sdp/output/hub.d
+++ b/src/sdp/output/hub.d
@@ -13,7 +13,7 @@ template outputHub() {
sdp.output.paths_output;
void outputHub(D,I)(D doc_abstraction, I doc_matters) {
mixin SiSUoutputRgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
if ((doc_matters.opt_action["verbose"])) {
writeln(doc_matters.keys_seq.seg);
}
@@ -92,7 +92,7 @@ template outputHubOp() {
sdp.output.paths_output;
void outputHubOp(C)(C config) {
mixin SiSUoutputRgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
if ((config["sqlite-create"])) {
if ((config["verbose"])) { writeln("sqlite create table... "); }
// SQLtableCreate!()();
diff --git a/src/sdp/output/paths_output.d b/src/sdp/output/paths_output.d
index bf88b54..8d689d0 100644
--- a/src/sdp/output/paths_output.d
+++ b/src/sdp/output/paths_output.d
@@ -9,7 +9,7 @@ import std.array,
import sdp.meta.rgx;
template SiSUpathsSisupod() {
mixin SiSUrgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
string base_dir = "sisupod";
string suffix = ".zip";
auto SiSUpathsSisupod()() {
@@ -29,7 +29,7 @@ template SiSUpathsSisupod() {
}
template SiSUpathsSisupodZipped() {
mixin SiSUrgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
auto SiSUpathsSisupodZipped(Ps,Lng)(
Ps src_pth_info,
Lng lng,
@@ -81,7 +81,7 @@ template SiSUpathsSisupodZipped() {
}
template SiSUpathsSisupodFileSystem() {
mixin SiSUrgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
auto SiSUpathsSisupodFileSystem(Ps,Lng)(
Ps src_pth_info,
Lng lng,
@@ -149,7 +149,7 @@ template SiSUoutPaths() {
}
template SiSUpathsHTML() {
mixin SiSUrgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
auto SiSUpathsHTML(Ps,Lng)(
Ps src_pth_info,
Lng lng,
@@ -188,7 +188,7 @@ template SiSUpathsHTML() {
}
template SiSUpathsEPUB() {
mixin SiSUrgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
auto SiSUpathsEPUB(Ps,Lng)(
Ps src_pth_info,
Lng lng,
diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d
index d7b326f..c0dc234 100644
--- a/src/sdp/output/paths_source.d
+++ b/src/sdp/output/paths_source.d
@@ -11,7 +11,7 @@ import std.array,
import sdp.meta.rgx;
template SiSUpathsSRC() {
mixin SiSUrgxInit;
- auto rgx = Rgx();
+ static auto rgx = Rgx();
auto SiSUpathsSRC(D,Fn)(
D _pwd,
Fn _fn_src_and_relative_path,
diff --git a/src/sdp/output/rgx.d b/src/sdp/output/rgx.d
index 728e3f9..343561b 100644
--- a/src/sdp/output/rgx.d
+++ b/src/sdp/output/rgx.d
@@ -2,9 +2,9 @@
regex: regular expressions used in sisu document parser
+/
module sdp.output.rgx;
-template SiSUoutputRgxInit() {
+static template SiSUoutputRgxInit() {
import sdp.output.defaults;
- struct Rgx {
+ static struct Rgx {
static newline = ctRegex!("\n", "mg");
static strip_br = ctRegex!("^<br>\n|<br>\n*$");
static space = ctRegex!(`[ ]`, "mg");
diff --git a/src/sdp/output/source_sisupod.d b/src/sdp/output/source_sisupod.d
index bb8ea80..db19f68 100644
--- a/src/sdp/output/source_sisupod.d
+++ b/src/sdp/output/source_sisupod.d
@@ -23,7 +23,7 @@ template SiSUpod() {
auto pth_sisupod_filesystem = SiSUpathsSisupodFileSystem!()(src_path_info, lng);
mixin SiSUlanguageCodes;
auto lang = Lang();
- auto rgx = Rgx();
+ static auto rgx = Rgx();
assert (doc_matters.source_filename.match(rgx.src_fn));
try {
/+ create directory structure +/
diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d
index b86fb46..1181c6f 100644
--- a/src/sdp/output/xmls.d
+++ b/src/sdp/output/xmls.d
@@ -13,7 +13,7 @@ template outputXHTMLs() {
sdp.output.xmls_css;
mixin SiSUoutputRgxInit;
struct outputXHTMLs {
- auto rgx = Rgx();
+ static auto rgx = Rgx();
string special_characters(O)(
auto return ref const O obj,
string _txt