aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_header_extract.d
blob: cf6dca132d2a9712c17a28b44963519823defcfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/+
  extract native/orig header return json
+/
template SiSUheaderExtractHub() {
  private import
    std.regex;
  private import
    ao_rgx;
  struct HeaderDocMetadataAndMake {
    mixin SiSUheaderExtractNative;
    mixin SiSUheaderExtractSDLang;
    auto rgx = Rgx();
    private auto headerContentJSON(char[] header_src, JSONValue[string] conf_doc_make_json) {
      auto head_native = HeaderDocMetadataAndMakeNativeToJson();
      auto head_sdlang = HeaderExtractSDL();
      writeln(__LINE__);
      auto header_make_and_meta_tuple = (match(header_src, rgx.native_header_meta_title))
      ? (head_native.headerNativeToJSON(header_src))
      : (head_sdlang.headerSDLangToJSON(header_src, conf_doc_make_json));
      writeln(__LINE__);
      static assert(!isTypeTuple!(header_make_and_meta_tuple));
      return header_make_and_meta_tuple;
    }
  }
}