aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ao_read_source_files.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-06-23 00:55:33 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-04 14:48:18 -0400
commita87a80c4528ce1bfd0090b425f4194eddf33699c (patch)
treedeac30591c1617e66a7543015e42a802a80ab61a /org/ao_read_source_files.org
parentstep5 sdlang used for config files and doc headers (diff)
step5.1 headers sdlang (like native headers) converted to json for common internal formatdoc-reform_v0.0.5
Diffstat (limited to 'org/ao_read_source_files.org')
-rw-r--r--org/ao_read_source_files.org69
1 files changed, 2 insertions, 67 deletions
diff --git a/org/ao_read_source_files.org b/org/ao_read_source_files.org
index 05e42ec..52537be 100644
--- a/org/ao_read_source_files.org
+++ b/org/ao_read_source_files.org
@@ -149,68 +149,6 @@ final private char[][] header0Content1(in string src_text) {
}
#+END_SRC
-** header sdlang
-
-#+name: ao_header_extract_sdl
-#+BEGIN_SRC d
-final private auto headerMakeSDLang(in string src_header) {
- scope(failure) {
- stderr.writefln(
- "%s\n%s\n%s:%s failed here:\n src_header: %s",
- __MODULE__, __FUNCTION__,
- __FILE__, __LINE__,
- src_header,
- );
- }
- Tag sdl_root_header;
- try {
- sdl_root_header = parseSource(src_header);
- }
- catch(SDLangParseException e) {
- stderr.writeln("SDLang problem with this document header:");
- stderr.writeln(src_header);
- // Error messages of the form:
- // myFile.sdl(5:28): Error: Invalid integer suffix.
- stderr.writeln(e.msg);
- }
- debug(sdlang) {
- // // Value is a std.variant.Algebraic
- // Value output_dir_structure_by = sdl_root_header.tags["output_dir_structure_by"][0].values[0];
- // assert(output_dir_structure_by.type == typeid(string));
- // writeln(output_dir_structure_by);
-
- // Tag person = sdl_root_header.namespaces["myNamespace"].tags["person"][0];
- // writeln("Name: ", person.attributes["name"][0].value);
- //
- // int age = person.tags["age"][0].values[0].get!int();
- // writeln("Age: ", age);
-
- writeln("header SDL:");
- writeln(sdl_root_header.toSDLDocument());
- }
- return sdl_root_header;
-}
-#+END_SRC
-
-** header sdlang :header:
-#+name: ao_header_extract_sdl
-#+BEGIN_SRC d
-private auto headerSDLang(in char[] src_header) {
- char[][] source_header_arr =
- split(cast(char[]) src_header, rgx.line_delimiter);
- char[] header_clean;
- foreach(header_line; source_header_arr) {
- if (!match(header_line, rgx.comments)) {
- header_clean ~= header_line ~ "\n";
- // writeln(header_line);
- }
- }
- // writeln(header_clean); // consider
- auto header_sdlang=headerMakeSDLang(to!string(header_clean));
- return header_sdlang;
-}
-#+END_SRC
-
** source line array :array:
#+name: ao_markup_source_raw
#+BEGIN_SRC d
@@ -298,14 +236,14 @@ if (type1["curly_code"] == 1) {
contents_insert ~= line;
} else if (
(type1["header_make"] == 1)
- && matchFirst(line, rgx.header_sub)
+ && matchFirst(line, rgx.native_header_sub)
) {
type1["header_make"] = 1;
type1["header_meta"] = 0;
// cont_dynamic_array ~= "% " ~ line;
} else if (
(type1["header_meta"] == 1)
- && matchFirst(line, rgx.header_sub)
+ && matchFirst(line, rgx.native_header_sub)
) {
type1["header_meta"] = 1;
type1["header_make"] = 0;
@@ -468,9 +406,6 @@ template SiSUmarkupRaw() {
}
}
private
- struct HeaderExtractSDL {
- <<ao_header_extract_sdl>>
- }
struct MarkupRawUnit {
private import std.file;
// enum State { off, on }