From 5a4df097b2976c24c449c56cf035995edfb1261e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 7 Mar 2017 09:11:09 -0500 Subject: 0.13.6 dlang function calls, syntax (ufcs related), logic should be retained --- src/sdp/ao_read_source_files.d | 47 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'src/sdp/ao_read_source_files.d') diff --git a/src/sdp/ao_read_source_files.d b/src/sdp/ao_read_source_files.d index 4acfe41..b47918a 100644 --- a/src/sdp/ao_read_source_files.d +++ b/src/sdp/ao_read_source_files.d @@ -44,7 +44,7 @@ template SiSUrawMarkupContent() { 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 + if (fn_src.match(rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise auto ins = Inserts(); auto tu = ins.scan_master_src_for_insert_files_and_import_content(sourcefile_body_content, fn_src); @@ -71,7 +71,7 @@ template SiSUrawMarkupContent() { string source_txt_str; try { if (exists(fn_src)) { - source_txt_str = readText(fn_src); + source_txt_str = fn_src.readText; } } catch (ErrnoException ex) { @@ -88,24 +88,25 @@ template SiSUrawMarkupContent() { final private char[][] header0Content1(in string src_text) { /+ split string on _first_ match of "^:?A~\s" into [header, content] array/tuple +/ char[][] header_and_content; - auto m = matchFirst(cast(char[]) src_text, rgx.heading_a); + auto m = (cast(char[]) src_text).matchFirst(rgx.heading_a); header_and_content ~= m.pre; header_and_content ~= m.hit ~ m.post; assert(header_and_content.length == 2, - "document markup is broken, header body split == " ~ to!string(header_and_content.length) ~ - "; (header / body array split should == 2 (split is on level A~))" + "document markup is broken, header body split == " + ~ header_and_content.length.to!string + ~ "; (header / body array split should == 2 (split is on level A~))" ); return header_and_content; } final private char[][] markupSourceLineArray(in char[] src_text) { char[][] source_line_arr = - split(cast(char[]) src_text, rgx.newline_eol_strip_preceding); + (cast(char[]) src_text).split(rgx.newline_eol_strip_preceding); return source_line_arr; } auto markupSourceReadIn(in string fn_src) { auto rgx = Rgx(); enforce( - match(fn_src, rgx.src_pth), + fn_src.match(rgx.src_pth), "not a sisu markup filename" ); auto source_txt_str = readInMarkupSource(fn_src); @@ -129,7 +130,7 @@ template SiSUrawMarkupContent() { Regex!(char) rgx_file ) { enforce( - match(fn_src, rgx_file), + fn_src.match(rgx_file), "not a sisu markup filename" ); auto source_txt_str = readInMarkupSource(fn_src); @@ -146,17 +147,17 @@ template SiSUrawMarkupContent() { mixin SiSUrgxInitFlags; char[][] contents_insert; auto type1 = flags_type_init; - auto fn_pth_full = match(fn_src, rgx.src_pth); + auto fn_pth_full = fn_src.match(rgx.src_pth); auto markup_src_file_path = fn_pth_full.captures[1]; foreach (line; markup_sourcefile_insert_content) { if (type1["curly_code"] == 1) { type1["header_make"] = 0; type1["header_meta"] = 0; - if (matchFirst(line, rgx.block_curly_code_close)) { + if (line.matchFirst(rgx.block_curly_code_close)) { type1["curly_code"] = 0; } contents_insert ~= line; - } else if (matchFirst(line, rgx.block_curly_code_open)) { + } else if (line.matchFirst(rgx.block_curly_code_open)) { type1["curly_code"] = 1; type1["header_make"] = 0; type1["header_meta"] = 0; @@ -164,28 +165,28 @@ template SiSUrawMarkupContent() { } else if (type1["tic_code"] == 1) { type1["header_make"] = 0; type1["header_meta"] = 0; - if (matchFirst(line, rgx.block_tic_close)) { + if (line.matchFirst(rgx.block_tic_close)) { type1["tic_code"] = 0; } contents_insert ~= line; - } else if (matchFirst(line, rgx.block_tic_code_open)) { + } else if (line.matchFirst(rgx.block_tic_code_open)) { type1["tic_code"] = 1; type1["header_make"] = 0; type1["header_meta"] = 0; contents_insert ~= line; } else if ( (type1["header_make"] == 1) - && matchFirst(line, rgx.native_header_sub) + && line.matchFirst(rgx.native_header_sub) ) { type1["header_make"] = 1; type1["header_meta"] = 0; } else if ( (type1["header_meta"] == 1) - && matchFirst(line, rgx.native_header_sub) + && line.matchFirst(rgx.native_header_sub) ) { type1["header_meta"] = 1; type1["header_make"] = 0; - } else if (auto m = match(line, rgx.insert_src_fn_ssi_or_sst)) { + } else if (auto m = line.match(rgx.insert_src_fn_ssi_or_sst)) { type1["header_make"] = 0; type1["header_meta"] = 0; auto insert_fn = m.captures[2]; @@ -229,27 +230,27 @@ template SiSUrawMarkupContent() { mixin SiSUrgxInitFlags; char[][] contents; auto type = flags_type_init; - auto fn_pth_full = match(fn_src, rgx.src_pth); + auto fn_pth_full = fn_src.match(rgx.src_pth); auto markup_src_file_path = fn_pth_full.captures[1]; string[] insert_file_list =[]; foreach (line; sourcefile_body_content) { if (type["curly_code"] == 1) { - if (matchFirst(line, rgx.block_curly_code_close)) { + if (line.matchFirst(rgx.block_curly_code_close)) { type["curly_code"] = 0; } contents ~= line; - } else if (matchFirst(line, rgx.block_curly_code_open)) { + } else if (line.matchFirst(rgx.block_curly_code_open)) { type["curly_code"] = 1; contents ~= line; } else if (type["tic_code"] == 1) { - if (matchFirst(line, rgx.block_tic_close)) { + if (line.matchFirst(rgx.block_tic_close)) { type["tic_code"] = 0; } contents ~= line; - } else if (matchFirst(line, rgx.block_tic_code_open)) { + } else if (line.matchFirst(rgx.block_tic_code_open)) { type["tic_code"] = 1; contents ~= line; - } else if (auto m = match(line, rgx.insert_src_fn_ssi_or_sst)) { + } else if (auto m = line.match(rgx.insert_src_fn_ssi_or_sst)) { auto insert_fn = m.captures[2]; auto insert_sub_pth = m.captures[1]; auto fn_src_insert = @@ -257,7 +258,7 @@ template SiSUrawMarkupContent() { insert_file_list ~= to!string(fn_src_insert); auto raw = MarkupRawUnit(); /+ TODO +/ - if (auto ma = match(line, rgx.src_fn_text)) { + if (auto ma = line.match(rgx.src_fn_text)) { /+ .sst when inserted, not used: headers and heading level ^:?A~ so remove +/ writeln(__LINE__); writeln(ma); } -- cgit v1.2.3