diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-11-29 19:43:05 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-11-29 19:43:05 -0800 |
commit | 6f8a6cf7c99810aa6c7f2254bce22c0fd1eedebe (patch) | |
tree | 9c6dc3ed39c6692e92dcbac8da279b6850d160cd /parser.y | |
parent | 317f52faaee418a3a64b8c7d7a778e78b65e84c6 (diff) | |
download | txr-6f8a6cf7c99810aa6c7f2254bce22c0fd1eedebe.tar.gz txr-6f8a6cf7c99810aa6c7f2254bce22c0fd1eedebe.tar.bz2 txr-6f8a6cf7c99810aa6c7f2254bce22c0fd1eedebe.zip |
Support assignment to (car ...) and (cdr ...).
* eval.c (car_s, cdr_s): New symbol variables.
(op_modplace): Cases for car and cdr added.
(expand_place): Likewise. Calls abort should the
cases fall through rather than returning 42.
(expand): Bugfix: for and for* case not propagating
source location info. Bugfix: expansion for do added.
(eval_init): car_s and cdr_s initialized and used
in place of previous intern calls.
* parser.y (elem): Removed wrong logic for expanding the
do form. It was expanding only the first argument.
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -293,14 +293,9 @@ elem : texts { $$ = rlcp(cons(text_s, $1), $1); $$ = rlcp(optimize_text($$), $$); } | var { $$ = rl($1, num(lineno)); } | list { if (first($1) == do_s) - { val form = second($1); - val form_ex = expand(form); - - if (form == form_ex) - $$ = $1; - else - $$ = rlcp(cons(do_s, cons(form_ex, nil)), - $1); }} + $$ = expand($1); + else + $$ = $1; } | COLL exprs_opt ')' elems END { $$ = list(coll_s, $4, nil, $2, nao); rl($$, num($1)); } | COLL exprs_opt ')' elems |