summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-02-15 06:57:59 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-02-15 06:57:59 -0800
commite7831ed8f0b67b463be1e01e6c0254fb98d13848 (patch)
tree8cc88f1bccb454b4f191b6197830dbb0ffea80ab /parser.y
parent28020fb827625d41c1252c9e34690114607506ec (diff)
downloadtxr-e7831ed8f0b67b463be1e01e6c0254fb98d13848.tar.gz
txr-e7831ed8f0b67b463be1e01e6c0254fb98d13848.tar.bz2
txr-e7831ed8f0b67b463be1e01e6c0254fb98d13848.zip
Support horizontal @(block), phase 1.
Unresolved issue: horizontal @(accept) terminating in a vertical @(block) or horizontal @(block) in a different line, or vertical @(accept) caught in horizontal context. * match.c (h_block, h_accept_fail): New functions. (dir_tables_init): Register horizontal @(block), @(accept) and @(fail). * parser.y (elem): Support BLOCK syntax.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index 5a2ef76f..14bad936 100644
--- a/parser.y
+++ b/parser.y
@@ -486,10 +486,15 @@ elem : texts { $$ = rlcp(cons(text_s, $1), $1);
args, nao);
rl($$, num($1));
rl($6, car($5)); }
+ | BLOCK exprs_opt ')' elems END { $$ = list(block_s, car($2),
+ cons($4, nil), nao);
+ rl($$, num($1)); }
| COLL error { $$ = nil;
yybadtok(yychar, lit("coll clause")); }
| REP error { $$ = nil;
yybadtok(yychar, lit("rep clause")); }
+ | BLOCK error { $$ = nil;
+ yybadtok(yychar, lit("rep clause")); }
| ALL clause_parts_h { $$ = rl(list(all_s, t, $2, nao), num($1)); }
| SOME exprs_opt ')'
clause_parts_h { $$ = rl(list(some_s, t, $4, $2, nao), num($1)); }