summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-04-18 08:19:39 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-04-18 08:19:39 -0700
commitc765b773e63b2099a050fef21b5e7f06296af2ec (patch)
treee68ccefcd290fc98079133d9a62d83ea03110731
parentada08e1b0c7d8d61dc59cadb5eefd665522d149a (diff)
downloadtxr-c765b773e63b2099a050fef21b5e7f06296af2ec.tar.gz
txr-c765b773e63b2099a050fef21b5e7f06296af2ec.tar.bz2
txr-c765b773e63b2099a050fef21b5e7f06296af2ec.zip
Fix quasistring regression introduced in TXR 81.
* parser.y (expand_meta): This function must recognize quasistrings, inside (sys:quasi ...) forms, (sys:var ...) forms do not denote TXR Lisp variables. These must not be expanded. Doing so is not only wrong, but the way it was done broke brace variables by stripping their arguments.
-rw-r--r--ChangeLog10
-rw-r--r--parser.y16
2 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ba0d649a..ab9270b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-04-18 Kaz Kylheku <kaz@kylheku.com>
+
+ Fix quasistring regression introduced in TXR 81.
+
+ * parser.y (expand_meta): This function must recognize
+ quasistrings, inside (sys:quasi ...) forms, (sys:var ...) forms
+ do not denote TXR Lisp variables. These must not be expanded.
+ Doing so is not only wrong, but the way it was done broke
+ brace variables by stripping their arguments.
+
2015-04-16 Kaz Kylheku <kaz@kylheku.com>
Adding exit* function which calls _exit.
diff --git a/parser.y b/parser.y
index 6abd646d..071a090f 100644
--- a/parser.y
+++ b/parser.y
@@ -1206,6 +1206,22 @@ static val expand_meta(val form, val menv)
menv = default_arg(menv, make_env(nil, nil, nil));
+ if ((sym = car(form)) == quasi_s) {
+ list_collect_decl (out, ptail);
+
+ for (; consp(form); form = cdr(form)) {
+ val subform = car(form);
+ if (consp(subform) && car(subform) == expr_s)
+ ptail = list_collect(ptail, expand_meta(subform, menv));
+ else
+ ptail = list_collect(ptail, subform);
+ }
+
+ ptail = list_collect_nconc(ptail, form);
+
+ return rlcp(out, form);
+ }
+
if ((sym = car(form)) == expr_s) {
val exp_x = expand(rest(form), menv);
if (!bindable(exp_x))