From a87a80c4528ce1bfd0090b425f4194eddf33699c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 23 Jun 2016 00:55:33 -0400 Subject: step5.1 headers sdlang (like native headers) converted to json for common internal format --- org/ao_read_source_files.org | 69 ++------------------------------------------ 1 file changed, 2 insertions(+), 67 deletions(-) (limited to 'org/ao_read_source_files.org') 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 { - <> - } struct MarkupRawUnit { private import std.file; // enum State { off, on } -- cgit v1.2.3