aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2020-04-28 14:20:01 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2020-05-20 11:27:26 -0400
commit69a5eaad6c474bc7d397dbade39c8180e8351a81 (patch)
tree3569714522b6bc7ac742f508eddcbba5747e2322
parentmarkup conversion (diff)
0.11.0 in_source_files, changed tracking of code blocks
-rw-r--r--meson.build4
-rw-r--r--org/in_source_files.org55
-rw-r--r--org/spine.org2
-rw-r--r--org/spine_build_scaffold.org4
-rw-r--r--src/doc_reform/io_in/read_source_files.d55
-rw-r--r--views/version.txt2
6 files changed, 64 insertions, 58 deletions
diff --git a/meson.build b/meson.build
index d6bb5de..74ad756 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
project('spine', 'd',
- license: 'AGPL3',
- version: '0.9.2',
+ license: 'AGPL-3',
+ version: '0.11.0',
meson_version: '>=0.46'
)
#if meson.get_compiler('d').get_id() == 'gcc'
diff --git a/org/in_source_files.org b/org/in_source_files.org
index 05e9889..49c4a5e 100644
--- a/org/in_source_files.org
+++ b/org/in_source_files.org
@@ -516,7 +516,9 @@ split is on first match of level A~ (which is required)
#+NAME: meta_inserts_scan
#+BEGIN_SRC d
char[][] contents_insert;
-int[string] type1 = flags_type_init;
+int code_block_status = 0;
+enum codeBlock { off, curly, tic, }
+int[string] type = flags_type_init;
auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm);
auto markup_src_file_path = fn_pth_full.captures[1];
#+END_SRC
@@ -525,33 +527,33 @@ auto markup_src_file_path = fn_pth_full.captures[1];
#+NAME: meta_inserts_scan_loop
#+BEGIN_SRC d
-if (type1["curly_code"] == 1) {
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+if (code_block_status == codeBlock.curly) {
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
if (line.matchFirst(rgx.block_curly_code_close)) {
- type1["curly_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents_insert ~= line;
} else if (line.matchFirst(rgx.block_curly_code_open)) {
- type1["curly_code"] = 1;
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ code_block_status = codeBlock.curly;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
contents_insert ~= line;
-} else if (type1["tic_code"] == 1) {
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+} else if (code_block_status == codeBlock.tic) {
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
if (line.matchFirst(rgx.block_tic_close)) {
- type1["tic_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents_insert ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
- type1["tic_code"] = 1;
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ code_block_status = codeBlock.tic;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
contents_insert ~= line;
} else if (auto m = line.match(rgx.insert_src_fn_ssi_or_sst)) {
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
auto insert_fn = m.captures[2];
auto insert_sub_pth = m.captures[1];
auto fn_src_insert
@@ -582,8 +584,8 @@ if (type1["curly_code"] == 1) {
- build image list, search for any image files to add to image list
+/
} else {
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
contents_insert ~= line; // images to extract for image list?
if (_opt_action.source || _opt_action.pod) {
string[] _image_linelist = _extract_images(line);
@@ -611,7 +613,8 @@ return t;
#+NAME: meta_master_doc_scan_for_insert_filenames
#+BEGIN_SRC d
char[][] contents;
-int[string] type = flags_type_init;
+int code_block_status = 0;
+enum codeBlock { off, curly, tic, }
auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm);
auto markup_src_file_path = fn_pth_full.captures[1];
char[][] contents_insert;
@@ -623,21 +626,21 @@ string[] insert_file_list =[];
#+NAME: meta_master_doc_scan_for_insert_filenames_loop
#+BEGIN_SRC d
-if (type["curly_code"] == 1) {
+if (code_block_status == codeBlock.curly) {
if (line.matchFirst(rgx.block_curly_code_close)) {
- type["curly_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents ~= line;
} else if (line.matchFirst(rgx.block_curly_code_open)) {
- type["curly_code"] = 1;
+ code_block_status = codeBlock.curly;
contents ~= line;
-} else if (type["tic_code"] == 1) {
+} else if (code_block_status == codeBlock.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
- type["tic_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
- type["tic_code"] = 1;
+ code_block_status = codeBlock.tic;
contents ~= line;
} else if (auto m = line.match(rgx.insert_src_fn_ssi_or_sst)) {
auto insert_fn = m.captures[2];
diff --git a/org/spine.org b/org/spine.org
index 0f9b7a1..b8f6609 100644
--- a/org/spine.org
+++ b/org/spine.org
@@ -41,7 +41,7 @@ struct Version {
#+NAME: spine_version_current_set
#+BEGIN_SRC d
-enum _ver = Version(0, 10, 0);
+enum _ver = Version(0, 11, 0);
#+END_SRC
** compilation restrictions (supported compilers)
diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org
index 8842f52..0e06c4e 100644
--- a/org/spine_build_scaffold.org
+++ b/org/spine_build_scaffold.org
@@ -1030,8 +1030,8 @@ cat spine_sources.txt
#+BEGIN_SRC sh :tangle ../meson.build
project('spine', 'd',
- license: 'AGPL3',
- version: '0.9.2',
+ license: 'AGPL-3',
+ version: '0.11.0',
meson_version: '>=0.46'
)
#if meson.get_compiler('d').get_id() == 'gcc'
diff --git a/src/doc_reform/io_in/read_source_files.d b/src/doc_reform/io_in/read_source_files.d
index 2959cc6..349729d 100644
--- a/src/doc_reform/io_in/read_source_files.d
+++ b/src/doc_reform/io_in/read_source_files.d
@@ -175,37 +175,39 @@ template spineRawMarkupContent() {
) {
mixin spineRgxDocStructFlags;
char[][] contents_insert;
- int[string] type1 = flags_type_init;
+ int code_block_status = 0;
+ enum codeBlock { off, curly, tic, }
+ int[string] type = flags_type_init;
auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm);
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 (code_block_status == codeBlock.curly) {
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
if (line.matchFirst(rgx.block_curly_code_close)) {
- type1["curly_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents_insert ~= line;
} else if (line.matchFirst(rgx.block_curly_code_open)) {
- type1["curly_code"] = 1;
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ code_block_status = codeBlock.curly;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
contents_insert ~= line;
- } else if (type1["tic_code"] == 1) {
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ } else if (code_block_status == codeBlock.tic) {
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
if (line.matchFirst(rgx.block_tic_close)) {
- type1["tic_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents_insert ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
- type1["tic_code"] = 1;
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ code_block_status = codeBlock.tic;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
contents_insert ~= line;
} else if (auto m = line.match(rgx.insert_src_fn_ssi_or_sst)) {
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
auto insert_fn = m.captures[2];
auto insert_sub_pth = m.captures[1];
auto fn_src_insert
@@ -236,8 +238,8 @@ template spineRawMarkupContent() {
- build image list, search for any image files to add to image list
+/
} else {
- type1["header_make"] = 0;
- type1["header_meta"] = 0;
+ type["header_make"] = 0;
+ type["header_meta"] = 0;
contents_insert ~= line; // images to extract for image list?
if (_opt_action.source || _opt_action.pod) {
string[] _image_linelist = _extract_images(line);
@@ -261,28 +263,29 @@ template spineRawMarkupContent() {
import std.algorithm;
mixin spineRgxDocStructFlags;
char[][] contents;
- int[string] type = flags_type_init;
+ int code_block_status = 0;
+ enum codeBlock { off, curly, tic, }
auto fn_pth_full = fn_src.match(rgx.src_pth_sst_or_ssm);
auto markup_src_file_path = fn_pth_full.captures[1];
char[][] contents_insert;
string[] _images =[];
string[] insert_file_list =[];
foreach (line; sourcefile_body_content) {
- if (type["curly_code"] == 1) {
+ if (code_block_status == codeBlock.curly) {
if (line.matchFirst(rgx.block_curly_code_close)) {
- type["curly_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents ~= line;
} else if (line.matchFirst(rgx.block_curly_code_open)) {
- type["curly_code"] = 1;
+ code_block_status = codeBlock.curly;
contents ~= line;
- } else if (type["tic_code"] == 1) {
+ } else if (code_block_status == codeBlock.tic) {
if (line.matchFirst(rgx.block_tic_close)) {
- type["tic_code"] = 0;
+ code_block_status = codeBlock.off;
}
contents ~= line;
} else if (line.matchFirst(rgx.block_tic_code_open)) {
- type["tic_code"] = 1;
+ code_block_status = codeBlock.tic;
contents ~= line;
} else if (auto m = line.match(rgx.insert_src_fn_ssi_or_sst)) {
auto insert_fn = m.captures[2];
diff --git a/views/version.txt b/views/version.txt
index 05cfccf..36c1240 100644
--- a/views/version.txt
+++ b/views/version.txt
@@ -4,7 +4,7 @@ struct Version {
int minor;
int patch;
}
-enum _ver = Version(0, 10, 0);
+enum _ver = Version(0, 11, 0);
version (Posix) {
version (DigitalMars) {
} else version (LDC) {