aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_rgx.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-06-14 23:25:36 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-04 14:48:18 -0400
commit9bec897cdada305cae8ce78809dc3f9fe9cf8776 (patch)
treed05d0e4f2d9a9b2c5273e0a33bbbdf84580543b2 /src/sdp/ao_rgx.d
parentstep4 some additional work (diff)
step4.1 as step4 but extract header meta & make on first reading in documentdoc-reform_v0.0.4
Diffstat (limited to 'src/sdp/ao_rgx.d')
-rw-r--r--src/sdp/ao_rgx.d27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d
index 073148e..1245a71 100644
--- a/src/sdp/ao_rgx.d
+++ b/src/sdp/ao_rgx.d
@@ -7,13 +7,6 @@ template RgxInit() {
/+ misc +/
static flag_action = ctRegex!(`^(--[a-z][a-z0-9-]+)$`);
static flag_action_str = ctRegex!(` (--[a-z][a-z0-9-]+)`);
- static src_pth = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[tm])$`);
- static src_fn =
- ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P<fn_src>(?P<fn_base>[a-zA-Z0-9._-]+)[.](?P<fn_src_suffix>ss[tm]))$`);
- static src_fn_master = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ssm)$`);
- static src_fn_find_inserts = ctRegex!(`^([a-zA-Z0-9._-]+/)*([a-zA-Z0-9._-]+[.]ss[im])$`);
- // static ssm_fn = ctRegex!(`^[a-zA-Z0-9._-]+[.]ssm$`);
- static line_delimiter = ctRegex!("\n");
// static arr_delimiter = ctRegex!(`\s*[;]\s*`);
static within_quotes = ctRegex!(`"(.+?)"`);
static make_heading_delimiter = ctRegex!(`[;][ ]*`);
@@ -23,28 +16,36 @@ template RgxInit() {
static book_index_go = ctRegex!("([0-9]+)(?:-[0-9]+)?");
static trailing_comma = ctRegex!(",[ ]*$");
static trailing_linebreak = ctRegex!(",[ ]{1,2}\\\\\\\\\n[ ]{4}$","m");
+ static line_delimiter = ctRegex!("\n");
static line_delimiter_ws_strip = ctRegex!("[ ]*\n[ ]*");
static line_delimiter_only = ctRegex!("^\n");
static para_delimiter = ctRegex!("\n[ ]*\n+");
static levels_markup = ctRegex!(`^[A-D1-4]$`);
static levels_numbered = ctRegex!(`^[0-9]$`);
static levels_numbered_headings = ctRegex!(`^[0-7]$`);
- /+ insert markup file +/
- // static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*([a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[ti])$`);
+ static src_pth = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[tm])$`);
+ static src_fn =
+ ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P<fn_src>(?P<fn_base>[a-zA-Z0-9._-]+)[.](?P<fn_src_suffix>ss[tm]))$`);
+ static src_fn_master = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssm)$`);
+ static src_fn_text = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]sst)$`);
+ static src_fn_insert = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssi)$`);
+ static src_fn_find_inserts = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`);
static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[ti])$`);
// static insert_ssi_or_sst_fn = ctRegex!(`^<<\s*[a-zA-Z0-9._-]+[.]ss[ti]`);
/+ comments +/
static comment = ctRegex!(`^%+ `);
+ static comments = ctRegex!(`^%+ |^%+$`);
/+ header +/
static header = ctRegex!(`^@([a-z_]+):(?:\s|$)`);
static header_make = ctRegex!(`^@(make):(?:\s|$)`);
- static header_metadata = ctRegex!(`^@([a-z_]+):(?:\s|$)`);
+ static header_meta = ctRegex!(`^@([a-z_]+):(?:\s|$)`);
static header_sub = ctRegex!(`^[ ]+:([a-z_]+):\s`);
- static head_main = ctRegex!(`^@([a-z_]+):\s*(.*)`, "m");
- static head_sub = ctRegex!(`^[ ]*:([a-z_]+):\s+(.+)`, "m");
+ static head_main = ctRegex!(`^@(?P<header>[a-z_]+):\s*(?P<content>.*)`, "m");
+ static head_sub = ctRegex!(`^[ ]*:(?P<subheader>[a-z_]+):\s+(?P<content>.+)`, "m");
static head_value_title = ctRegex!(`@title`);
static head_value_author = ctRegex!(`@author`);
/+ heading & paragraph operators +/
+ static heading_a = ctRegex!(`^:?[A][~] `, "m");
static heading = ctRegex!(`^:?([A-D1-4])[~]([a-z0-9_.-]*[?]?) `);
static heading_marker = ctRegex!(`^:?([A-D1-4])[~]`);
static heading_title = ctRegex!(`^:?[A-D1-4][~][a-z0-9_.-]*[?]?\s+(.+?)$`);
@@ -147,7 +148,7 @@ template RgxInit() {
// static auto_obj_cite_number_ignore = ctRegex!(`^[+~*$-]{3,}$`); // reminder
static obj_cite_number_block_marks = ctRegex!(`^--[+~-]#$`);
/+ ignore outside code blocks +/
- static regular_parse_skip = ctRegex!(`^(--[+~-]#|-[\\]{2}-|=[.\\]{2}=)$`); // not structural info
+ static skip_code_block_from_regular_parse = ctRegex!(`^(--[+~-]#|-[\\]{2}-|=[.\\]{2}=)$`); // not structural info
/+ line & page breaks +/
static break_line_within_object = ctRegex!(`[\\]{2}( |$)`);
// static break_line_break_within_object = ctRegex!(`( |^)[\\]{2}( |$)`);