From df70e45dae4adccca01441e0911d2f5e114e8e7f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 17 Nov 2011 21:12:08 -0800 Subject: 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. --- parser.l | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'parser.l') 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]; } +,[*] { + yylval.chr = '*'; + return SPLICE; + } + +[,'] { + yylval.chr = yytext[0]; + return yytext[0]; + } + \}|\) { yy_pop_state(); if (yy_top_state() == INITIAL -- cgit v1.2.3