summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-30 12:26:41 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-30 12:26:41 -0800
commitac08d22c2b916fbd88c938569e0cd6af488b7a67 (patch)
tree845a929d332f67cc7ec6bd5196b3acf3d52f69b7 /parser.l
parent0b81b8b4c39b6c60cbbe8de5a6a785beb43c3dbb (diff)
downloadtxr-ac08d22c2b916fbd88c938569e0cd6af488b7a67.tar.gz
txr-ac08d22c2b916fbd88c938569e0cd6af488b7a67.tar.bz2
txr-ac08d22c2b916fbd88c938569e0cd6af488b7a67.zip
* match.c (counter_k): New keyword symbol variable.
(do_output_line): Process new :counter argument of rep. (do_output): Ditto, for repeat. (syms_init): Intern new keyword symbol. * match.h (counter_k): Declared. * parser.l (REPEAT, REP): Lexical syntax changed to allow arguments. * parser.y (repeat_rep_helper): Takes extra argument, representing the repeat/rep args. This is inserted into the second position of the output list. (repeat_clause, rep_elem): Extract repeat/rep arguments and pass to repeat_rep_helper. (yybadtoken): Do not put quotes around the word "number". * txr.1: Updated.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l8
1 files changed, 4 insertions, 4 deletions
diff --git a/parser.l b/parser.l
index c571691c..59e7767e 100644
--- a/parser.l
+++ b/parser.l
@@ -285,15 +285,15 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return OUTPUT;
}
-<SPECIAL>\({WS}repeat{WS}\) {
- yy_pop_state();
+<SPECIAL>\({WS}repeat/{ID_END} {
+ yy_push_state(NESTED);
yylval.lineno = lineno;
return REPEAT;
}
-<SPECIAL>\({WS}rep{WS}\) {
- yy_pop_state();
+<SPECIAL>\({WS}rep/{ID_END} {
+ yy_push_state(NESTED);
yylval.lineno = lineno;
return REP;
}