summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-11-17 21:12:08 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-11-17 21:12:08 -0800
commitdf70e45dae4adccca01441e0911d2f5e114e8e7f (patch)
treeab71125a6493e59b609eb5bc80bae30690d1baa9 /parser.l
parent68ca87bc780e25dea1418019161d99727225d1ce (diff)
downloadtxr-df70e45dae4adccca01441e0911d2f5e114e8e7f.tar.gz
txr-df70e45dae4adccca01441e0911d2f5e114e8e7f.tar.bz2
txr-df70e45dae4adccca01441e0911d2f5e114e8e7f.zip
Adding quote and unquote read syntax to list forms, resembling
Lisp. The difference is that splice is spelled ,* because @ already means something, and that there is only one quote operator. None of this does anything; it is only syntax. * lib.c (quote_s, qquote_s, unquote_s, splice_s): New variables. (obj_init): New variables initialized. * lib.h (quote_s, qquote_s, unquote_s, splice_s): Declared. * parser.l: Added recognition rules. * parser.y (SPLICE): New symbolic token. (list): Added new syntax for quote and splicing.
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l10
1 files changed, 10 insertions, 0 deletions
diff --git a/parser.l b/parser.l
index 6514a39b..ccc8cf05 100644
--- a/parser.l
+++ b/parser.l
@@ -371,6 +371,16 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
return yytext[0];
}
+<SPECIAL,NESTED>,[*] {
+ yylval.chr = '*';
+ return SPLICE;
+ }
+
+<SPECIAL,NESTED>[,'] {
+ yylval.chr = yytext[0];
+ return yytext[0];
+ }
+
<SPECIAL,NESTED>\}|\) {
yy_pop_state();
if (yy_top_state() == INITIAL