From 7f0f22c4e455f457d37ddf542b36c49db20d16af Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 13 Mar 2012 22:02:48 -0700 Subject: 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. --- parser.l | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'parser.l') 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; } +\({WS}block/{ID_END} { + yy_push_state(NESTED); + yylval.lineno = lineno; + return BLOCK; +} + \({WS}choose/{ID_END} { yy_push_state(NESTED); yylval.lineno = lineno; -- cgit v1.2.3