aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/meta/conf_make_meta_json.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-02-27 15:40:05 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitcf2fd4660ed50da2fbccec7912e429f1d5e37377 (patch)
treef573231485287877c84f4dfb1f0af5275c35b353 /src/sdp/meta/conf_make_meta_json.d
parentplaying with header/make substitutions (diff)
0.25.0 remove sdlang (headers, conf, make doc)
Diffstat (limited to 'src/sdp/meta/conf_make_meta_json.d')
-rw-r--r--src/sdp/meta/conf_make_meta_json.d23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/sdp/meta/conf_make_meta_json.d b/src/sdp/meta/conf_make_meta_json.d
index 0471dbf..c5585ce 100644
--- a/src/sdp/meta/conf_make_meta_json.d
+++ b/src/sdp/meta/conf_make_meta_json.d
@@ -75,7 +75,28 @@ static template contentJSONtoSiSUstruct() {
_struct_composite.make_str.num_depth = _json.object["num_depth"][""].str;
}
if ("substitute" in _json.object["make"]) {
- _struct_composite.make_str.substitute = _json.object["make"]["substitute"].arrayNoRef;
+ string[][] _sub;
+ if (
+ (_json.object["make"]["substitute"].type().to!string == "ARRAY")
+ && (_json.object["make"]["substitute"][0].type().to!string == "ARRAY")
+ ) {
+ foreach (substitute_pair; _json.object["make"]["substitute"].arrayNoRef) {
+ if ((substitute_pair.type().to!string) == "ARRAY") {
+ if (!empty(substitute_pair[0].str) && !empty(substitute_pair[1].str)) {
+ _sub ~= [ substitute_pair[0].str, substitute_pair[1].str];
+ }
+ }
+ }
+ } else if (
+ (_json.object["make"]["substitute"].type().to!string == "ARRAY")
+ && (_json.object["make"]["substitute"][0].type().to!string == "STRING")
+ ) {
+ if (!empty(_json.object["make"]["substitute"][0].str) && !empty(_json.object["make"]["substitute"][1].str)) {
+ _sub = [[_json.object["make"]["substitute"][0].str, _json.object["make"]["substitute"][1].str]];
+ }
+ }
+ // writeln(_sub);
+ _struct_composite.make_str.substitute = _sub;
}
if ("texpdf_font" in _json.object["make"]) {
_struct_composite.make_str.texpdf_font = _json.object["make"]["texpdf_font"].str;