diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-01-14 09:42:04 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 4b12f27165efb0c7b38ae9338c6ec3cc42b4f6b5 (patch) | |
tree | 8b9b6e3b6b53ac4fad0b8ab9e9ceb38425576df9 /org/ao_read_source_files.org | |
parent | 0.11.0 improved message passing, using templates (diff) |
insert file list: gather & make available a list of insert files (if any)
Diffstat (limited to 'org/ao_read_source_files.org')
-rw-r--r-- | org/ao_read_source_files.org | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/org/ao_read_source_files.org b/org/ao_read_source_files.org index 819f1ff..1ab28bf 100644 --- a/org/ao_read_source_files.org +++ b/org/ao_read_source_files.org @@ -93,20 +93,25 @@ template SiSUmarkupRaw() { } final auto sourceContentSplitIntoHeaderAndBody(in string source_txt_str, in string fn_src="") { auto raw = MarkupRawUnit(); + string[] insert_file_list; auto t = raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str); auto header_raw = t[0]; auto sourcefile_body_content = t[1]; if (match(fn_src, rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise auto ins = Inserts(); - sourcefile_body_content = + auto tu = ins.scan_master_src_for_insert_files_and_import_content(sourcefile_body_content, fn_src); + static assert(!isTypeTuple!(tu)); + sourcefile_body_content = tu[0]; + insert_file_list = tu[1].dup; } t = tuple( header_raw, - sourcefile_body_content + sourcefile_body_content, + insert_file_list ); - static assert(t.length==2); + static assert(t.length==3); return t; } } @@ -321,13 +326,15 @@ auto markupSourceReadIn(in string fn_src) { #+name: ao_markup_source_raw_tuple_of_header_and_body #+BEGIN_SRC d auto markupSourceHeaderContentRawLineTupleArray(in string source_txt_str) { + string[] file_insert_list = []; auto hc = header0Content1(source_txt_str); auto header = hc[0]; char[] source_txt = hc[1]; auto source_line_arr = markupSourceLineArray(source_txt); auto t = tuple( header, - source_line_arr + source_line_arr, + file_insert_list ); return t; } @@ -457,6 +464,7 @@ char[][] contents; auto type = flags_type_init; auto fn_pth_full = match(fn_src, rgx.src_pth); auto markup_src_file_path = fn_pth_full.captures[1]; +string[] insert_file_list =[]; #+END_SRC **** loop master scan for inserts (insert documents) @@ -484,6 +492,7 @@ if (type["curly_code"] == 1) { auto insert_sub_pth = m.captures[1]; auto fn_src_insert = chainPath(markup_src_file_path, insert_sub_pth ~ insert_fn).array; + insert_file_list ~= to!string(fn_src_insert); auto raw = MarkupRawUnit(); /+ TODO +/ if (auto ma = match(line, rgx.src_fn_text)) { @@ -528,7 +537,11 @@ debug(insert) { // insert file writeln(__LINE__); writeln(contents.length); } -return contents; +auto t = tuple( + contents, + insert_file_list +); +return t; #+END_SRC * figure out |