summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-03-13 22:02:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-03-13 22:02:48 -0700
commit7f0f22c4e455f457d37ddf542b36c49db20d16af (patch)
treeae4b2ed4afa05a8714c86f80ce5a9d4a8d4afe05 /parser.l
parentbe33de3909100a204726cdde52bf6077e890ca6d (diff)
downloadtxr-7f0f22c4e455f457d37ddf542b36c49db20d16af.tar.gz
txr-7f0f22c4e455f457d37ddf542b36c49db20d16af.tar.bz2
txr-7f0f22c4e455f457d37ddf542b36c49db20d16af.zip
Change: @(block) requires @(end) from now on.
Blocks no longer extend to the end of the surrounding scope. * match.c (v_block): Rewrite for new syntax. * parser.l (BLOCK): New token type handled. * parser.y (BLOCK): New token. (block_clause): New nonterminal grammar symbol. (clause): Collateral fix: replaced a bunch of list(X, nao) forms with cons(X, nil). Introduced block_clause as a constituent of clause. * txr.1: Revamped documentation of block, and wrote about using blocks for reducing nested skips and reducing backtracking in general.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l6
1 files changed, 6 insertions, 0 deletions
diff --git a/parser.l b/parser.l
index 98a243ec..f7a655db 100644
--- a/parser.l
+++ b/parser.l
@@ -257,6 +257,12 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return CASES;
}
+<SPECIAL>\({WS}block/{ID_END} {
+ yy_push_state(NESTED);
+ yylval.lineno = lineno;
+ return BLOCK;
+}
+
<SPECIAL>\({WS}choose/{ID_END} {
yy_push_state(NESTED);
yylval.lineno = lineno;