aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_rgx.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-03-22 14:54:07 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitcdaba1c73f0555e1128a7a35addddcfaf715dbde (patch)
treebae4b5cbacd1db42d993b5043ff9c66c8478f08c /src/sdp/ao_rgx.d
parent0.13.6 dlang function calls, syntax (ufcs related), logic should be retained (diff)
0.13.7 tables ao and html output, poem html output
Diffstat (limited to 'src/sdp/ao_rgx.d')
-rw-r--r--src/sdp/ao_rgx.d29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d
index 109b0cf..deef9c6 100644
--- a/src/sdp/ao_rgx.d
+++ b/src/sdp/ao_rgx.d
@@ -24,9 +24,15 @@ template SiSUrgxInit() {
static newline_eol_delimiter_only = ctRegex!("^\n");
static line_delimiter_ws_strip = ctRegex!("[ ]*\n[ ]*");
static para_delimiter = ctRegex!("\n[ ]*\n+");
+ static table_col_delimiter = ctRegex!("[ ]*\n+", "mg");
+ static table_row_delimiter = ctRegex!("\n[ ]*\n+", "mg");
+ static table_row_delimiter_special = ctRegex!("[ ]*\n", "mg"); //
+ static table_col_delimiter_special = ctRegex!("[ ]*[|][ ]*", "mg"); //
static levels_markup = ctRegex!(`^[A-D1-4]$`);
static levels_numbered = ctRegex!(`^[0-9]$`);
static levels_numbered_headings = ctRegex!(`^[0-7]$`);
+ static numeric = ctRegex!(`[ 0-9,.-]+`);
+ static numeric_col = ctRegex!(`^[ 0-9,.$£₤Є€€¥-]+$`);
/+ comments +/
static comment = ctRegex!(`^%+ `);
static comments = ctRegex!(`^%+ |^%+$`);
@@ -80,20 +86,20 @@ template SiSUrgxInit() {
static para_indent_hang = ctRegex!(`^_([0-9])_([0-9]) `);
static para_attribs = ctRegex!(`^_(?:(?:[0-9])(?:_([0-9]))?|(?:[1-9])?[*]) `);
/+ blocked markup +/
- static block_open = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)");
+ static block_open = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)|^[{]table(~h)?(?P<columns>(?:[ ]+[0-9]+;)+)[}]");
static block_poem_open = ctRegex!("^((poem[{].*?$)|`{3} poem)");
/+ blocked markup tics +/
static block_tic_open = ctRegex!("^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)");
- static block_tic_code_open = ctRegex!("^`{3} (code)([.][a-z][0-9a-z_]+)?");
+ static block_tic_code_open = ctRegex!("^`{3} (?:code)(?:[.]([a-z][0-9a-z_]+))?(?:[ ]+([#]))?");
static block_tic_poem_open = ctRegex!("^`{3} (poem)");
static block_tic_group_open = ctRegex!("^`{3} (group)");
static block_tic_block_open = ctRegex!("^`{3} (block)");
static block_tic_quote_open = ctRegex!("^`{3} (quote)");
- static block_tic_table_open = ctRegex!("^`{3} (table)");
+ static block_tic_table_open = ctRegex!("^`{3} table(.*)");
static block_tic_close = ctRegex!("^(`{3})$","m");
/+ blocked markup curly +/
static block_curly_open = ctRegex!(`^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)`);
- static block_curly_code_open = ctRegex!(`^(code([.][a-z][0-9a-z_]+)?[{](.*?)$)`);
+ static block_curly_code_open = ctRegex!(`^(?:code(?:[.]([a-z][0-9a-z_]+))?[{]([#]?)\s*$)`);
static block_curly_code_close = ctRegex!(`^([}]code)`);
static block_curly_poem_open = ctRegex!(`^(poem[{].*?$)`);
static block_curly_poem_close = ctRegex!(`^([}]poem)`);
@@ -103,8 +109,16 @@ template SiSUrgxInit() {
static block_curly_block_close = ctRegex!(`^([}]block)`);
static block_curly_quote_open = ctRegex!(`^(quote[{].*?$)`);
static block_curly_quote_close = ctRegex!(`^([}]quote)`);
- static block_curly_table_open = ctRegex!(`^(table[{].*?$)`);
+ static block_curly_table_open = ctRegex!(`^table[{](.*)`);
static block_curly_table_close = ctRegex!(`^([}]table)`);
+ static block_curly_table_special_markup = ctRegex!(`^[{]table((~h)?(?P<columns>(?:[ ]+[0-9]+;)+))[}]`, "mg"); // sepcial table block markup
+ static table_head_instructions = ctRegex!(`(?P<c_heading>h)?(?:[ ]+c(?P<c_num>[0-9]);)?(?P<c_widths>(?:[ ]+[0-9]+[lr]?;)+)`);
+ static table_col_widths_and_alignment = ctRegex!(`(?P<width>[0-9]+)(?P<align>[lr]?)`);
+ static table_col_widths = ctRegex!(`(?P<widths>[0-9]+)`);
+ static table_col_align = ctRegex!(`(?P<align>[lr]?)`);
+ static table_col_align_match = ctRegex!(`(?P<align>[lr])`);
+ static table_col_separator = ctRegex!(`┊`);
+ static table_col_separator_nl = ctRegex!(`[┊]$`, "mg");
/+ inline markup footnotes endnotes +/
static inline_notes_curly_gen = ctRegex!(`~\{.+?\}~`, "m");
static inline_notes_curly = ctRegex!(`~\{\s*(.+?)\}~`, "mg");
@@ -173,6 +187,8 @@ template SiSUrgxInit() {
static space = ctRegex!(`[ ]`, "mg");
static two_spaces = ctRegex!(`[ ]{2}`, "mg");
static nbsp_char = ctRegex!(`░`, "mg");
+ static nbsp_and_space = ctRegex!(`&nbsp;[ ]`, "mg");
+ static nbsp_char_and_space = ctRegex!(`░[ ]`, "mg");
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]))$`);
@@ -219,5 +235,8 @@ template SiSUrgxInit() {
static inline_bold_line = ctRegex!(`^!_ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
static inline_italics_line = ctRegex!(`^/_ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
static inline_underscore_line = ctRegex!(`^__ (?P<text>.+?)((?: [\\]{2}|[~]#){0,2}$)`);
+ /+ table delimiters +/
+ static table_delimiter_col = ctRegex!("[ ]*[┊][ ]*", "mg"); //
+ static table_delimiter_row = ctRegex!("[ ]*\n", "mg"); //
}
}