From c22e8bf5e062a4efd9a4d4867582a34ad159d655 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 11 Oct 2016 17:31:01 -0400 Subject: naming convention: _functions_ using ref identified with _underscore_ --- org/ao_abstract_doc_source.org | 102 +++++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 45 deletions(-) (limited to 'org/ao_abstract_doc_source.org') diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index 05825e6..e1af062 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -248,7 +248,7 @@ debug(srclines) { #+name: abs_in_loop_body_00 #+BEGIN_SRC d if (!line.empty) { - check_obj_cite_number_status(line, type); + _check_obj_cite_number_status_(line, type); } #+END_SRC @@ -259,7 +259,7 @@ if (!line.empty) { #+BEGIN_SRC d if (type["code"] == TriState.on) { /+ block object: code +/ - code_block(line, an_object, type); + _code_block_(line, an_object, type); continue; #+END_SRC @@ -282,7 +282,7 @@ if ((matchFirst(line, rgx.heading_biblio) && (!matchFirst(line, rgx.heading)) && (!matchFirst(line, rgx.comment))) { /+ within block object: biblio +/ - biblio_block(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json); + _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json); debug(bibliobuild) { writeln("- ", biblio_entry_str_json); writeln("-> ", biblio_arr_json.length); @@ -296,7 +296,7 @@ if ((matchFirst(line, rgx.heading_biblio) #+BEGIN_SRC d } else if (type["poem"] == TriState.on) { /+ within block object: poem +/ - poem_block(line, an_object, type, counter, obj_cite_number_poem, dochead_make_aa); + _poem_block_(line, an_object, type, counter, obj_cite_number_poem, dochead_make_aa); continue; #+END_SRC @@ -307,7 +307,7 @@ if ((matchFirst(line, rgx.heading_biblio) /+ within block object: group +/ } else if (type["group"] == TriState.on) { /+ within block object: group +/ - group_block(line, an_object, type); + _group_block_(line, an_object, type); continue; #+END_SRC @@ -317,7 +317,7 @@ if ((matchFirst(line, rgx.heading_biblio) #+BEGIN_SRC d } else if (type["block"] == TriState.on) { /+ within block object: block +/ - block_block(line, an_object, type); + _block_block_(line, an_object, type); continue; #+END_SRC @@ -327,7 +327,7 @@ if ((matchFirst(line, rgx.heading_biblio) #+BEGIN_SRC d } else if (type["quote"] == TriState.on) { /+ within block object: quote +/ - quote_block(line, an_object, type); + _quote_block_(line, an_object, type); continue; #+END_SRC @@ -337,7 +337,7 @@ if ((matchFirst(line, rgx.heading_biblio) #+BEGIN_SRC d } else if (type["table"] == TriState.on) { /+ within block object: table +/ - table_block(line, an_object, type); + _table_block_(line, an_object, type); continue; #+END_SRC @@ -372,7 +372,7 @@ if (matchFirst(line, rgx.block_open)) { processing.remove("verse"); obj_cite_number_poem["start"] = to!string(obj_cite_number); } - start_block(line, type, obj_cite_number_poem); + _start_block_(line, type, obj_cite_number_poem); continue; #+END_SRC @@ -420,7 +420,7 @@ if (matchFirst(line, rgx.block_open)) { || (matchFirst(line, rgx.book_index_open)) || (type["book_index"] == State.on )) { /+ book_index +/ - book_index(line, book_idx_tmp, an_object, type); + _book_index_(line, book_idx_tmp, an_object, type); #+END_SRC ******* not book index [+1] @@ -443,7 +443,7 @@ if (matchFirst(line, rgx.block_open)) { an_object["obj"] ~= line ~= "\n"; contents_the_objects ~= set_abstract_object.contents_comment(strip(an_object["obj"])); - header_set_common(line_occur, an_object, type); + _header_set_common_(line_occur, an_object, type); processing.remove("verse"); ++counter; #+END_SRC @@ -460,9 +460,7 @@ if (matchFirst(line, rgx.block_open)) { if ((dochead_make_aa["make"]["headings"].length > 2) && (type["make_headings"] == State.off)) { /+ heading found +/ - auto dochead_make_headings = - dochead_make_aa["make"]["headings"]; - heading_found(line, dochead_make_headings, heading_match_str, heading_match_rgx, type); + _heading_found_(line, dochead_make_aa["make"]["headings"], heading_match_str, heading_match_rgx, type); } if ((type["make_headings"] == State.on) && ((line_occur["para"] == State.off) @@ -470,14 +468,14 @@ if (matchFirst(line, rgx.block_open)) { && ((type["para"] == State.off) && (type["heading"] == State.off))) { /+ heading make set +/ - heading_make_set(line, line_occur, heading_match_rgx, type); + _heading_make_set_(line, line_occur, heading_match_rgx, type); } if (matchFirst(line, rgx.heading)) { /+ heading match +/ - heading_matched(line, line_occur, an_object, lv, collapsed_lev, type, dochead_meta_aa); + _heading_matched_(line, line_occur, an_object, lv, collapsed_lev, type, dochead_meta_aa); } else if (line_occur["para"] == State.off) { /+ para match +/ - para_match(line, an_object, indent, bullet, type, line_occur); + _para_match_(line, an_object, indent, bullet, type, line_occur); } #+END_SRC @@ -515,7 +513,7 @@ if (matchFirst(line, rgx.block_open)) { #+BEGIN_SRC d } else if (type["blocks"] == TriState.closing) { /+ line empty, with blocks flag +/ - block_flag_line_empty(line, an_object, contents_the_objects, bookindex_unordered_hashes, obj_cite_number, node, counter, type, obj_cite_number_poem, dochead_make_aa); // watch + _block_flag_line_empty_(line, an_object, contents_the_objects, bookindex_unordered_hashes, obj_cite_number, node, counter, type, obj_cite_number_poem, dochead_make_aa); // watch #+END_SRC ****** line empty [+1] @@ -587,7 +585,7 @@ if ((type["heading"] == State.on) // writeln(contents_am[counter]["obj_cite_number"], " ", contents_am[counter]["obj"]); // writeln(m.hit, "\n"); } - header_set_common(line_occur, an_object, type); + _header_set_common_(line_occur, an_object, type); an_object.remove("lev"); an_object.remove("lev_markup_number"); // an_object["lev_markup_number"]="9"; @@ -637,7 +635,7 @@ if ((type["heading"] == State.on) // indent, // bullet // ); - header_set_common(line_occur, an_object, type); + _header_set_common_(line_occur, an_object, type); indent["hang_position"] = "0"; indent["base_position"] = "0"; bullet = false; @@ -739,7 +737,7 @@ auto biblio_unsorted_incomplete = biblio_arr_json.dup; // destroy(biblio_arr_json); auto biblio = Bibliography(); auto biblio_ordered = - biblio.bibliography(biblio_unsorted_incomplete, bib_arr_json); + biblio._bibliography_(biblio_unsorted_incomplete, bib_arr_json); #+END_SRC *** [#B] bookindex :book:index: @@ -822,7 +820,7 @@ auto object_reset(ref string[string] an_object) { #+name: abs_functions #+BEGIN_SRC d -auto header_set_common( +auto _header_set_common_( ref int[string] line_occur, ref string[string] an_object, ref int[string] type @@ -840,7 +838,10 @@ auto header_set_common( #+name: abs_functions #+BEGIN_SRC d -void check_obj_cite_number_status(char[] line, ref int[string] type) { +void _check_obj_cite_number_status_( + char[] line, + ref int[string] type +) { if ((!line.empty) && (type["obj_cite_number_status_multi_obj"] == TriState.off)) { /+ not multi-line object, check whether obj_cite_number is on or turned off +/ if (matchFirst(line, rgx.obj_cite_number_block_marks)) { @@ -890,7 +891,7 @@ void check_obj_cite_number_status(char[] line, ref int[string] type) { #+name: abs_functions #+BEGIN_SRC d -void start_block( +void _start_block_( char[] line, ref int[string] type, string[string] obj_cite_number_poem @@ -1059,7 +1060,7 @@ void start_block( #+name: abs_functions #+BEGIN_SRC d -void code_block( +void _code_block_( char[] line, ref string[string] an_object, ref int[string] type @@ -1184,7 +1185,7 @@ final string biblio_tag_map_(string abr) { #+name: abs_functions #+BEGIN_SRC d -void biblio_block( +void _biblio_block_( char[] line, ref int[string] type, ref int bib_entry, @@ -1312,7 +1313,7 @@ why extra object stuff only in poem/verse? #+name: abs_functions #+BEGIN_SRC d -void poem_block( +void _poem_block_( char[] line, ref string[string] an_object, ref int[string] type, @@ -1515,7 +1516,7 @@ void poem_block( #+name: abs_functions #+BEGIN_SRC d -void group_block( +void _group_block_( char[] line, ref string[string] an_object, ref int[string] type @@ -1556,7 +1557,7 @@ void group_block( #+name: abs_functions #+BEGIN_SRC d -void block_block( +void _block_block_( char[] line, ref string[string] an_object, ref int[string] type @@ -1597,7 +1598,11 @@ void block_block( #+name: abs_functions #+BEGIN_SRC d -void quote_block(char[] line, ref string[string] an_object, ref int[string] type) { +void _quote_block_( + char[] line, + ref string[string] an_object, + ref int[string] type +) { if (type["curly_quote"] == TriState.on) { if (matchFirst(line, rgx.block_curly_quote_close)) { debug(quote) { // quote (curly) close @@ -1634,7 +1639,11 @@ void quote_block(char[] line, ref string[string] an_object, ref int[string] type #+name: abs_functions #+BEGIN_SRC d -void table_block(char[] line, ref string[string] an_object, ref int[string] type) { +void _table_block_( + char[] line, + ref string[string] an_object, + ref int[string] type +) { if (type["curly_table"] == TriState.on) { if (matchFirst(line, rgx.block_curly_table_close)) { debug(table) { // table (curly) close @@ -1671,7 +1680,7 @@ void table_block(char[] line, ref string[string] an_object, ref int[string] type #+name: abs_functions #+BEGIN_SRC d -void block_flag_line_empty( +void _block_flag_line_empty_( char[] line, ref string[string] an_object, ref ObjComposite[] contents_the_objects, @@ -1898,7 +1907,7 @@ void block_flag_line_empty( #+name: abs_functions #+BEGIN_SRC d -auto book_index( +auto _book_index_( char[] line, ref string book_idx_tmp, ref string[string] an_object, @@ -1950,22 +1959,22 @@ auto book_index( #+name: abs_functions #+BEGIN_SRC d -auto heading_found( +auto _heading_found_( char[] line, - string dochead_make_headings, + string dochead_make_identify_unmarked_headings, ref string[string] heading_match_str, ref Regex!(char)[string] heading_match_rgx, ref int[string] type ) { - if ((dochead_make_headings.length > 2) + if ((dochead_make_identify_unmarked_headings.length > 2) && (type["make_headings"] == State.off)) { /+ headings found +/ debug(headingsfound) { - writeln(dochead_make_headings); + writeln(dochead_make_identify_unmarked_headings); } char[][] make_headings_spl = split( - cast(char[]) dochead_make_headings, + cast(char[]) dochead_make_identify_unmarked_headings, rgx.make_heading_delimiter); debug(headingsfound) { writeln(make_headings_spl.length); @@ -2040,7 +2049,7 @@ auto heading_found( #+name: abs_functions #+BEGIN_SRC d -auto heading_make_set( +auto _heading_make_set_( ref char[] line, ref int[string] line_occur, ref Regex!(char)[string] heading_match_rgx, @@ -2102,7 +2111,7 @@ auto heading_make_set( #+name: abs_functions #+BEGIN_SRC d -auto heading_matched( +auto _heading_matched_( char[] line, ref int[string] line_occur, ref string[string] an_object, @@ -2247,7 +2256,7 @@ auto heading_matched( #+name: abs_functions #+BEGIN_SRC d -auto para_match( +auto _para_match_( char[] line, ref string[string] an_object, ref string[string] indent, @@ -3359,12 +3368,12 @@ struct NotesSection { string object_notes; long previous_count; int mkn; + auto rgx = Rgx(); #+END_SRC **** gather notes for endnote section struct open #+name: ao_emitters #+BEGIN_SRC d - auto rgx = Rgx(); private auto gather_notes_for_endnote_section( ObjComposite[] contents_am, ulong counter @@ -3501,11 +3510,14 @@ struct Bibliography { **** biblio #+name: ao_emitters #+BEGIN_SRC d - public JSONValue[] bibliography(ref string[] biblio_unsorted_incomplete, ref JSONValue[] bib_arr_json) + public JSONValue[] _bibliography_( + ref string[] biblio_unsorted_incomplete, + ref JSONValue[] bib_arr_json + ) in { } body { JSONValue[] biblio_unsorted = - biblio_unsorted_complete(biblio_unsorted_incomplete, bib_arr_json); + _biblio_unsorted_complete_(biblio_unsorted_incomplete, bib_arr_json); JSONValue[] biblio_sorted__ = biblio_sort(biblio_unsorted); biblio_debug(biblio_sorted__); debug(biblio0) { @@ -3529,7 +3541,7 @@ struct Bibliography { **** biblio unsorted complete #+name: ao_emitters #+BEGIN_SRC d - final private JSONValue[] biblio_unsorted_complete( + final private JSONValue[] _biblio_unsorted_complete_( string[] biblio_unordered, ref JSONValue[] bib_arr_json ) { -- cgit v1.2.3